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

I wonder how it deals with the lack of a garbage collector in C and C++. I could only find a single paragraph about it in the language reference and it doesn't seem to explain how to free memory in C, or how to deal with circular references in C++.

> Memory management is native to the target language. A garbage collector will be used if available in the target language. Otherwise (in C and C++), objects and arrays are allocated on the stack for maximum performance or on the heap for extra flexibility. Heap allocations use C++ smart pointers.



Evidently reference counting is used for C and C++, which means that circular references won't be collected, but in the absence of cycles everything is cleaned up.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: