Hacker News
points by tptacek 3 days ago | 0 comments
Malloc implementations are anything but boring!

https://csapp.cs.cmu.edu/3e/docs/dsa.pdf

[–] Mikhail_Edoshin 3 days ago
Malloc itself is not boring. What is boring and distracting is the need to think about managing memory when doing something else. (And we normally do something else.) Here the memory management part must be reduced to a mere technicality, some standard prologue/epilogue. It's not yet there, I think.
[–] cowlevel 3 days ago
GC languages do exactly that.
[–] Mikhail_Edoshin 3 days ago
True. But GC takes too much control. Using Pythons as an example, first all is well, but then you need to turn it off selectively and have to learn first the whole concept of (reference-counting) GC and then augment it with a new concept of weak references. (Which are not just objects without GC, they are objects with more complex GC routines.)

A thing appears simple when it allows you to make distinctions you care about and avoid making distinctions you do not care about. C is weak with the latter, but Python with the former.

[–] cowlevel 3 days ago
You can't give up control without giving up control...