-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
With snmalloc we can provide a custom meta-data per object that is attached to the standard snmalloc meta-data such as free lists.
snmalloc/src/snmalloc/backend_helpers/commonconfig.h
Lines 89 to 103 in 012138e
| struct ArrayClientMetaDataProvider | |
| { | |
| using StorageType = T; | |
| using DataRef = T&; | |
| static size_t required_count(size_t max_count) | |
| { | |
| return max_count; | |
| } | |
| static DataRef get(StorageType* base, size_t index) | |
| { | |
| return base[index]; | |
| } | |
| }; |
We could use this feature to store a single bit per object. The bit being set means the allocation does not consume the whole allocated space. The last byte then represents how much space is not being used by the allocation, i.e. 17 byte allocation, would have the last byte as 15 (32 - 17) and the bit would be set, whereas a 32 byte allocation would not have the bit set.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers