microsoft / microsoft/mimalloc
"Pointer compression/truncation" and huge pages
- Dominant language
- C
- Stars
- 13.4k
- Forks
- 1.2k
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 13
Description
Suppose,
- we ask mimalloc to use 1GB pages.
- we make a heap
- we make zillions mallocs/frees over the same heap as in step 2
- assume we do not realloc, re-calloc, move the heap memory
are there any guarantees that every pointer will share the same value in bits above the last physical bit usually 38 (zero based) because the memory is coming off the same page?
If so, one can play memory tricks like save the base address somewhere and cut 64-bit pointers down to 32-bits. Which, for tree like data structures could be a handy, cheap way to cut memory for pointers in half. Yes, there's pointer and/or bit games to play, but it may be worth playing.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files, tests, or entry points are named. Start by reviewing mimalloc's 1GB-page allocation behavior and the guarantees it makes about pointer addresses across repeated allocations and frees; done means documenting whether the proposed pointer truncation is guaranteed or unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100