c - How to allocate memory at a specific location -


this c.

i think malloc typically allocates next available space on heap after last allocation.

is possible have malloc not , choose on heap you'd memory allocated?

is there way in general allocate memory on heap , have not next address available "farther"?

basically, malloc'd space + more space getting overwritten (as test) i'm losing metadata associated malloc'd space since stored next malloc'd space (even though use different malloc call).

thanks, jeremy

to temporarily work around memory corruption of blocks of memory allocated malloc, allocate more memory need, blocks larger. give them more space erroneous modifications before program adversely affected.

do only temporary debugging purposes, can investigate program’s behavior while figuring out wrong.

additionally, there other techniques analyzing improper memory accesses, including analyzers such valgrind , debugger “watchpoint” features interrupt program , inform when chosen locations modified.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -