Y
yufufi
Hello,
How does delete[] know how much memory to deallocate from the given
pointer? AFAIK this informations is put there by new[]. new[] puts the
size of the allocated memory before the just before the beginning of the
array. But I couldn't find this information by looking at the memory.
(Via VS2005 - C++)
My second questions is, if there is a mechanism to know how much memory
is allocated for the array, why don't we use it for things like bstr?
Only thing I can think of is you may go and allocate a big chunk of
memory with new[] and use it for more then one bstr's and such. (However
i'm not even sure how you can do it with bstr since you have to use
::SysAllocString)
Thank you in advance,
Furkan
How does delete[] know how much memory to deallocate from the given
pointer? AFAIK this informations is put there by new[]. new[] puts the
size of the allocated memory before the just before the beginning of the
array. But I couldn't find this information by looking at the memory.
(Via VS2005 - C++)
My second questions is, if there is a mechanism to know how much memory
is allocated for the array, why don't we use it for things like bstr?
Only thing I can think of is you may go and allocate a big chunk of
memory with new[] and use it for more then one bstr's and such. (However
i'm not even sure how you can do it with bstr since you have to use
::SysAllocString)
Thank you in advance,
Furkan