3 ms·
just curious, do you allow malloc_gc'ed items to reference malloc'd ones?
by alexgartrell 16y ago
just curious, do you allow malloc_gc'ed items to reference malloc'd ones?
- huhtenberg 16y agoSure. malloc'ed item could be the same as malloc_gc'd, but with its reference count artificially bumped up by 1. free() would decrement the count and the item will be picked up by the GC later on. If there's a provision for an immediate disposal of unreferenced items, then we are back to the standard malloc/free behaviour in case when malloc and malloc_gc items are not mixed.
- p0nce 16y agoReference counting is a bad C++ substitute for a real GC.
- huhtenberg 16y agoSure, absolutely. Just as C++ is a bad substitute for a real language. (edit) </sarcasm>