std.container / tightArray / class (de)allocators

Robert M. Münch robert.muench at robertmuench.de
Wed Jun 16 09:26:51 PDT 2010


On 2010-06-16 15:33:40 +0200, BLS said:

> How to bring a (Tight)Array designed as memory watch dog and a fixed 
> sized, but chunked, memory mapped file together.
> I am curious .. (to say the least)

The idea is quite simple (not so much dependend on Array):

- implement a memory-allocator and manager that manages the free space 
in a memory mapped file (MMF)
- implement a based pointer type to have address independent pointers 
inside the MMF
- provide a way to allocate data-structures using based pointers via 
this memory manager in the memory mapped file
- use these data-structures at run-time

The run-time objects will be persistent by default. The based pointer 
ensures that links between such objects are pesistent. The memory 
manager keeps track of the free areas and used areas of the MMF much 
like a file-system.

As I don't want to mirror all D runtime stuff I'm seeking for a way to 
gently exchange/swap the normal GC memory allocator through a MMF 
allocator, without impacting the normal types, classes etc.

-- 
Robert M. Münch
http://www.robertmuench.de



More information about the Digitalmars-d mailing list