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

From what I've skimmed so far this isn't a very good or accurate resource. In particular it doesn't mention RAII in its discussion of C++, doesn't mention Rust at all, neglects the role of stack allocation, glosses over the common use of object pooling in GC languages as a workaround for performance issues, has little on the extra issues introduced by multithreaded code and understates the performance issues of GC.


It's actually a great resource. The glossary covers all these issues, except for Rust, which the site content predates. It tends to use more academic terminology instead of the current industry terminology, but the academic terminology is often more precise anyway. Yes, it's opinionated in favor of GC, but that's a perfectly defensible position (which may sound odd coming from me as a Rust developer, but I actually like GC in many—just not all—circumstances).

RAII is covered under "smart pointer": https://www.memorymanagement.org/glossary/s.html#term-smart-...

Stack allocation is here: https://www.memorymanagement.org/glossary/s.html#term-stack-...

Object pooling is covered under "segregated free list": https://www.memorymanagement.org/glossary/s.html#term-segreg...

Multithreaded GC is covered under "parallel garbage collection": https://www.memorymanagement.org/glossary/p.html#term-parall...


I disagree. A few short more or less related entries in the glossary is not really "covering". A paragraph on smart pointers that conflates the concept with reference counting is certainly not covering RAII. None of these adequately address the deficiencies I mentioned.


That paragraph on smart pointers doesn’t have anything to do with RAII - it’s not even accurate concerning C++ smart pointers, where the standard ‘has a single owner’ smart pointer doesn’t use ref counting, it uses RAII.


Probably the resource is older than 2018, and is taking aim shared_ptr (or maybe even auto_ptr?) rather than unique_ptr.


Both unique_ptr and shared_ptr have been standard since C++11 which is also when auto_ptr was deprecated (auto_ptr is/was also not reference counted).


do you know some good resources on the things you mentioned?


I don't know of one central resource that covers all of these topics. There are good articles on jemalloc and tcmalloc that discuss modern allocation strategies for general purpose allocators. There are articles from games development that discuss object pooling both in the context of C++ and in the context of optimizing GC languages like C# and Java as well as other specialized strategies like bump allocators, frame allocators, etc.

Resources on learning modern C++ cover RAII and resources on learning Rust cover its approach. There are good talks on the fairly new polymorphic allocator model for C++ that cover the motivations for it and use cases. Experience with modern C++ is valuable for understanding how much you can do with mostly stack allocation and how you can write non library code without ever writing a raw new or delete.




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

Search: