Cysharp / Cysharp/MemoryPack

Allow for opting out of Unmanaged struct optimizations.

Open
#440 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.7k
Forks
313
PR merge metrics
No merged PRs in 30d

Description

Currently, if a type is annotated with MemoryPackable and it is unmanaged, you can do essentially nothing to customize it, which is really annoying for my use case where I'm using unmanaged structs to hold integer keys to some external data and to serialize I need to write it out as that external data, but nope, this library won't let me. Consider seriously reworking the way unmanaged structs are handled so this library is actually usable for a case like this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how MemoryPackable types and unmanaged structs are handled during serialization. Determine how an opt-out would interact with custom serialization for external integer-key data, then define tests that distinguish optimized unmanaged serialization from the opted-out behavior. Done means the requested customization path is specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.