Short topics in memory management
Posted Mar 7, 2007 17:47 UTC (Wed) by
zlynx (subscriber, #2285)
In reply to:
Short topics in memory management by ibukanov
Parent article:
Short topics in memory management
Checking offset bounds may look easier than a pointer, but it isn't really. A pointer is nothing but an offset from memory location 0, after all.
if( pointer > mmap_base && pointer < mmap_end ) ...
Using an unsigned int offset instead saves you from checking the lower bound, but you lose that savings again the instant you segment your memory into different uses, like using some for text and some for graphics.
(
Log in to post comments)