Skip to content

Conversation

udoprog
Copy link
Contributor

@udoprog udoprog commented Sep 26, 2021

This changes the name and backtraces fields on Allocation to be Box<str> instead of String, netting us a mem::size_of::<Allocation>() decrease from 104 to 88 bytes.

Same could be done on AllocationError, but would be an API break.

Copy link
Member

@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to save 8 bytes per-String on the capcity field, these are "immutable" anyway :)

Copy link
Collaborator

@manon-traverse manon-traverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it makes sense for gpu-allocator. Thank you very much for your contribution! ^.^

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

Successfully merging this pull request may close these issues.

3 participants