Using Nim's heap allocator on a pre-allocated memory region

2024-07-31 Thread khaledh-nim
> I did an experiment where I wrapped `mmap` make all the memory used by a Nim > process shared so I could run a second program which loaded all the shared > memory and allowed the two programs to pass memory addresses between them. This is very similar to what I'm trying to do with my OS. Howev

Using Nim's heap allocator on a pre-allocated memory region

2024-07-31 Thread PMunch
You could always use GCCs wrap functionality. I did an experiment where I wrapped `mmap` to make all the memory used by a Nim process shared so I could run a second program which loaded all the shared memory and allowed the two programs to pass memory addresses between them. But I guess you'd ha

Using Nim's heap allocator on a pre-allocated memory region

2024-07-31 Thread khaledh-nim
Is it possible to use the heap allocator on a memory region that I provide during runtime? Typically Nim would use the OS allocator (mmap, VirtualAlloc) to grab memory pages for its allocator, but what if I have a fixed memory region that I'd like to use as a heap, is there a way to _[attach](h