9-Mar-00 10:39 you wrote:
Khimenko Victor wrote:
Hmm. It'll require locks in multithreaded program and will be not very convenient. Perhaps we can hide it over clever #define ? Let's try: [...] You need to EXPLICITLY change new strategy every time :-(( Especially annoying since you want to use GC_malloc_atomic for plain strings... [...]
What about introducing a second `New' that allows the user to pass an additional parameter to the allocator?
This is exactly what I want :-) Not just New, but rather full suite (in case of shared memory you need not only free but malloc as well). Any syntax you prefer p:=new(GC_malloc,integer); p:=new[GC_alloc](integer); p:=newex(GC_malloc,integer); ...
Sometimes alloc will need additional parameters -- somethig akin to p:=new[shmem_alloc,pool2](integer); but I'm not sure it it happens frequently enough to justify additional complexity...