CVS update: samba/source/smbd

Andrew Tridgell tridge at samba.org
Mon Sep 24 23:34:03 EST 2001


> What about fstrings?

Unnecessary zeroing of anything is bad. Samba is pretty much memory
bandwidth limited in many benchmarks and the reason we chew so much
memory bandwidth is the copying and zeroing of data.

That doesn't mean we should increase the complexity of the code just
to avoid some zeroing, but we shouldn't zero stuff needlessly.

I do often zero allocated structures just before freeing them because
that can often make catching bugs a lot easier, but zeroing stack
variables (particularly large ones like a string) is generally not a
good idea.

Use your common sense though. There are certainly cases where zeroing
a string is a good idea - I just thought that it was not needed in
your recent patch.

Cheers, Tridge




More information about the samba-cvs mailing list