Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Descriptor from MinidumpMemoryBase/UnifiedMemory #945

Open
Swatinem opened this issue Jan 31, 2024 · 0 comments
Open

Remove Descriptor from MinidumpMemoryBase/UnifiedMemory #945

Swatinem opened this issue Jan 31, 2024 · 0 comments

Comments

@Swatinem
Copy link
Collaborator

Working on #944 , I also found an annoyance / inefficiency with UnifiedMemory:

UnifiedMemory is an enum containing MinidumpMemoryBase with different generic parameters, so we are doing a match on that as well on each access.

MINIDUMP_MEMORY_DESCRIPTOR/64 are both 16 bytes, so we might as well just wrap the Descriptor in an enum, and remove all the generic parameters from MinidumpMemory(List)Base.

This should clean up the code with less generics, and also avoid a match in the hot code path. I doubt any hot code path ever cares about the inner descriptor, so we might as well remove it completely from MinidumpMemoryBase, and move it someplace else.

Another observation is that MinidumpMemoryBase.size is pretty redundant with MinidumpMemoryBase.bytes.len(), so might as well remove that too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant