Note that there are some explanatory texts on larger screens.

plurals
  1. POFighting fragmentation in custom memory manager
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COBTW, how do you make dlmalloc wait-free without a major rewrite? I can understand making the small allocs in dlmalloc lock free using SLIST (Atomic list) primitives since they are just size-binned freelists but waitfree is a bit more difficult. Also, you have to be very carefully if you are trimming (returning memory to the OS) with lock-free and wait-free methods unless you use hazard pointers or garbage collection to avoid the race condition where you can dereferencing linked nodes that have been freed back to the OS.
      singulars
    2. COThe system is just based of Doug Lea's concept (didn't want to go through and learn the code then alter it), but if you give each thread its own bins and blocks to allocate from (if you just try to do bins alone, then you will have problems combining consecutive blocks of memory together), then the allocation functions are already wait free. All you need to do then is handle deallocations in a wait free manner (which I did by just placing them all in a list to be properly deallocated by the owner thread).
      singulars
    3. COTo request/return memory from the OS, I just used a mutex. This is the only part that isn't wait free, thus the only time threads can block each other is when they both request new memory from the OS at the same time (if something wants to release to the OS, but another thread is interacting with the OS, then it just skips this and will try again at a later point in the app).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload