Hi,

The MSVC help files say that a call to free() with an invalid pointer,
that is, one not previously associated with a call to malloc,calloc etc, may not function correctly.

However, what if a block of memory is assigned to a pointer with malloc, then the address of the memory block is hashed, and the address of the memory block is later returned to the original pointer...will free() function correctly under these conditions ?

What I need to do is this:

dynamically allocate an unknown number of memory blocks of unknown sizes, which can be retrived and accessed in an unknown order. At any time, a particular block of memory might become redundant and therefore, preferably, should be deleted (freed).

The hashed address system apears to works fine, but I cannot tell if the redundant pages are really being de-allocated by free().

Can any one help, or suggest a better method?

rob