Login
You're viewing the techdon.dev public feed.

Replies

  • Sep 18, 2026, 2:34 PM

    one thing i'm thinking is that 8 byte heap allocations make little sense. i plan for value types and unboxed integers, so there will be much less of a need to have tiny heap objects.

    💬 1🔄 0⭐ 1
  • Sep 18, 2026, 2:48 PM

    i don't think there's much call for having data more than cacheline-aligned unless it's very aligned indeed (i.e. pages). so we can consider regions for multiples of 16, 32 and 64 bytes and get natural alignment on them. this seems like comparable waste to an allocator.

    then we can use a very old trick indeed and compress two of these into one region by allocating from both ends until they meet in the middle. in the old days it used to be the stack and the heap meeting in the middle, of course.

    💬 1🔄 0⭐ 2
  • 💬 1🔄 0⭐ 0
  • Sep 18, 2026, 3:48 PM

    i guess we get to choose between synchronising allocation of pinned data or wasting memory. i expect pinned data is generally going to be fairly long-lived (buffers and such). you only need to pin data so long as C stuff can get at it, which is usually only for the duration of an ffi call, but async i/o apis of course break this assumption.

    💬 1🔄 0⭐ 0
  • Sep 18, 2026, 6:20 PM

    okay, so moving GCs are free of fragmentation, right? allegedly, anyway. but what is fragmentation? i think it only covers leaving holes that aren't quickly reused.

    anyway fragmentation seems lesser than the other thing moving collectors give you - relocating data to be contiguous in memory. i wonder how much that's good for.

    💬 1🔄 0⭐ 0
  • Sep 18, 2026, 6:32 PM

    so earlier, when i was musing about size classes, i overlooked something important: there is no fragmentation with size classes beyond padding things to the next size up if they are smaller. well there needn't be if you're already tracing, anyway.

    this also means the only reason to evacuate would be to merge partially filled blocks of the same size class.

    the downside is that each thread needs at least one block of each size class that it's allocating into. but again, this is comparable to ordinary allocators. so one partially filled block of one of each size class that's been encountered. that's kind of an annoying constant overhead.

    now why haven't i heard of anyone doing this before?

    💬 0🔄 0⭐ 0