HNHacker News
TopNewBestAskShowJobs

esneider

197 karma · joined December 8, 2013

submissionscomments
esneider··on Bit Twiddling Hacks (2005)
I wrote that algorithm! A year later I found Hacker's delight, a wonderful book that had a much "faster" version of the same algorithm (less ops).

For anyone interested in this kind of things, you should go read that book. It actually is a delight.

esneider··on Talloc: The Tutorial
Fair enough... I thought it would be more difficult/inefficient to check for cyclic hierarchies, but it wasn't.

Fixed! Thanks.

esneider··on Talloc: The Tutorial
Yep, you can also do

  void *p;
  free(p);
  free(p);
Don't get me wrong, I get where you are going. But C philosophy is that libraries shouldn't do expensive checking to detect programmers' errors.
esneider··on Talloc: The Tutorial
Hierarchical memory allocations are a great concept. But Samba's talloc is kind of bloated, with all the reference counting, destructors and stuff.

Here is a simple, 200-line version of just the hierarchical allocator: https://github.com/esneider/talloc