Original Post
Hi,
Just reading about memory allocators right now here: http://gee.cs.oswego.edu/dl/html/malloc.html . I understand that when you request say sizeof(char) with malloc(), on some machines the actual bytes returned isn''t the exact sizeof(char), but instead aligned to the machine''s word size.
My question is, since malloc() will need extra bytes to do housekeeping, some information relating to the size of the block, whether its in use or not, etc. will need to be placed near the returned block of memory. However I have a question as to where this information is placed in relation to this returned block? Before? After? If its before (which means right at the pointer) then when you dereference the pointer you will get that housekeeping information too, which isn''t really what you want. If it''s after, then you don''t really know how far you must look?
If anyone can point me to some articles or answer these questions it would be great.
Thanks.