Hacker News new | past | comments | ask | show | jobs | submit login
Closures, Objects, and the Fauna of the Heap (duartes.org)
35 points by luu on Oct 27, 2014 | hide | past | favorite | 1 comment



Good article, but the depiction of stack vs. heap as "the price is you must now remember to free() memory or take a performance hit on a garbage collector [...] stack and heap: performance vs. flexibility." isn't quite so cut-and-dry. You can always grab large chunks of memory and perform allocation out of it yourself with decent performance and some determinism or pre-allocate space on the stack before calling a function to allow it to pass back a limited amount of dynamic data. Memory allocators are designed for good performance in most cases, but given a more specific case, you can usually do something better yourself :-)




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: