Saturday, May 14, 2005

14. Do pointer descriptors own and manage the memory they point to?

No. Absolutely not.

The memory that holds the data referenced by a pointer descriptor is not owned by it, but will have been previously allocated. Pointer descriptors are agnostic about where the memory they point to is actually stored (in ROM, on the heap or on the stack).

The string data of a pointer descriptor is separate from the descriptor object itself and pointer descriptors themselves are usually stack-based, although they can be used on the heap, for example as a member variable of a CBase-derived class.

This page is powered by Blogger. Isn't yours?

Google
WWW Descriptors FAQ