Mail Archives: djgpp/2000/08/23/19:20:58
Hello sorry to revisit this subejct but
a day or two ago i asked about possibility of alligning memory
so that say malloc(25) returns address x and then one modulates this address
so that it is alligned to a multiple of say 64 bytes. (by making malloc(25+63))
the problem is - how would one free memory that is a remainder of offset?
for example say malloc returns 5 (pseudo example only) so then one
modifies it to say 10...
now the memory from location 5 to location 9 is theoretically not used
and thus could be used when some other allocation needs to take place -
the thing is - how can i free memory from locaton 5 to location 9 keeping the rest (from loc 10 to whatever was allocated)...
is there some sort of free(ptr,x)
call which would only free a certain portion starting at ptr and for amount of x bytes?
- Raw text -