Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

just curious, do you allow malloc_gc'ed items to reference malloc'd ones?


Sure.

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.


Reference counting is a bad C++ substitute for a real GC.


Sure, absolutely. Just as C++ is a bad substitute for a real language.

(edit) </sarcasm>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: