From: Sage Weil Date: Fri, 27 Sep 2013 22:29:18 +0000 (-0700) Subject: common/buffer: explicitly init zbuf to zeros X-Git-Tag: v0.72-rc1~42^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3e9344103525dbbb7dc8cd70a4b8c1df134685d;p=ceph.git common/buffer: explicitly init zbuf to zeros This might not be necessary? Signed-off-by: Sage Weil --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 3a8190f0280b..064775d29931 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -31,8 +31,17 @@ namespace ceph { - -static unsigned char zbuf[128]; + // some zeros; used when concatenating buffers with cached crc + static unsigned char zbuf[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; #ifdef BUFFER_DEBUG static uint32_t simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;