My original use of this method was in a program which would literally run for years. An implementation which would checkerboard the heap would ultimately cause problems despite the absence of leaks.

Both Unix and Windows support this POSIX feature, and both permit anonymous allocation so it is a good way of dynamically allocating memory in programs portable between Unix and Windows and for implementing shared memory cacheing, buffering or communication in a portable manner.

A simple and high performance way of implementing a modest sized single table is to mmap it as a text file and use a fast string search like Boyer-Moore to locate records (rows) in a table search. It can be used to implement tiny footprint flexible data lookups given reasonable size limits.

Teg wrote:
Hello John,

Thanks. I might look into that. The memory manager I use is a block
allocator with sub-allocator and coalesces free'd memory as it's
returned to the allocator. I don't actually ever "malloc" or "free". I
let STL handle all the memory management so, I don't really have to
worry about memory leaks.

C

Tuesday, January 2, 2007, 8:34:45 AM, you wrote:

JS> A very simple and efficient method of holding temporary results is to JS> just read it into a temporary file which is memory mapped. The VM JS> manager takes care of the memory buffering so you do not have to be JS> concerned about upper size limits being constrained by memory resources.
JS>   The file can be anonymous to make the process tidier (subject to a few
JS> limitations).

JS> Traversing the list is just a matter of reading forwards and back either
JS> by using a file handles and the read API or by using a pointer.  It have
JS> not tried using a pointer to such a structure in a list control, but it
JS> may be possible.

JS> Avoiding using mallocs for dynamic memory allocation makes for less JS> possibility of checkerboarding in long running processes.

JS> Teg wrote:

Hello Roger,







-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to