3 ms·
C and C++ both have very popular GC libraries which fulfill much the same purpose and even have the same design (the optional Boehm GC, for example). Those are
by netbioserror 4y ago
C and C++ both have very popular GC libraries which fulfill much the same purpose and even have the same design (the optional Boehm GC, for example). Those are likely good examples to look at to see how managed memory might be invoked by the Nim compiler. Alternatively, if you're using reference counting, that's simply C++'s preferred style (std::unique_ptr), as you already said. I can't speak to whether Nim's compiled code is using std::unique_ptr or something else.