Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: If you're going to write your own allocator, you need to respect the MEMORY_ALLOCATION_ALIGNMENT

$
0
0

@Joshua: the pointer itself has zeroes in its 4 least significant bits, because it points to a 16 byte aligned address. Now you can stuff things (like count/length/size) into the pointer itself, and dereference through "*(((uintptr_t)p)&~((uintptr_t)15))". See en.wikipedia.org/.../Tagged_pointer


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>