>>>>> "SC" == Sergio Carvalho <[EMAIL PROTECTED]> writes:
SC> a chunk'. Does this mean that if I resize a chunk, MemHandleSize will
SC> return the old size?
SC> In pseudo-code:
SC> h = MemHandleNew(10); // Alloc 10 byte chunk
SC> MemHandleResize(hm 20); // Resize it to 20
SC> // And now for the bigfinale
SC> MemHandleSize(h); // What is the return value for MemHandleSize? 10
SC> or 20?
I beleave it returns 20 because you "REQUESTED size of 20" at
MemHandleResize(), if MemHandleResize() succeeds.
What this "request" means is, that memory chunk manager does not
allocate size you have requested. Instead, chunk manager usullay
expand the requested size and allocate chunk with that expanded
size. So, when you ask for the size of chunk, system have to select
which to return. "requested" or "truely allocated". And
MemHandleSize() will return "requested".
I don't know how large will the MemoryMgr expand the size, but for
example, on some unix, malloc expand requested size to multiple of
16, if you request more then 2048 byte, it'll expand the size to
multiple of 4096(size of 'page').
----
Kenichi Okuyama @Tokyo Research Lab. IBM Japan. Co.