| ▲ | thomasmg 5 days ago |
| If you want to use a standard malloc / free implementation (dlmalloc etc.) then dead object need to be known, yes. But the malloc library could be fully integrated into the GC mechanism. In this case, there is no need. That's probably much easier, and faster, because the malloc can be simplified to bumping a pointer. |
|
| ▲ | kragen 5 days ago | parent [-] |
| That works if you use a copying garbage collector, but not a non-moving collector like FUGC. |
| |
| ▲ | thomasmg 5 days ago | parent [-] | | OK, I did not read the source code of the FUGC, but the article mentions "FUGC relies on a sweeping algorithm based on bitvector SIMD." So, assuming there is just one bit per block of memory, then there is no need to visit the memory of the dead objects in the sweep phase. The bit of the dead object is zero, and so that memory block is considered free and available for reallocation. There is no need to visit the free block. | | |
| ▲ | kragen 5 days ago | parent [-] | | It's true that it doesn't dirty up your dcache, but it's "visiting" enough that it wouldn't "need a lot more special support if it wanted to report the dead objects," which is the context of the discussion here. |
|
|