On Sat, Jun 02, 2007 at 03:30:39PM -0400, simo wrote:
> First answer: Magic ;-)
> More seriously, it really depends.
Second answer... I would be a little more liberal with
copying stuff if I had to trade it for complexity. When
talloc_steal was not yet renamed to talloc_move S3 kind of
banned talloc_steal, and I converted some routines from
using it to either different code structure or to copying.
This experience really taught me a lesson: The code was a
lot more readable after that conversion, the hierarchy was
a bit less complex.
Another experience of mine is very fresh: I tried to
implement dgram and stream based messaging with some complex
socket state / callback talloc hierarchy. I stared at the
code for hours to fix a segfault, but I could not. So 3.0.26
will still see the tdb-based stuff with some simple ctdb
connect. The lesson is that complex hierarchies are quite
hard to debug, even if you've written them just a couple of
hours ago... :-)