From: Mike Frysinger Date: Mon, 15 Nov 2010 16:52:53 -0500 Subject: [U-Boot] [PATCH] malloc: Fix issue with calloc memory possibly being non-zero In-Reply-To: <1289854274-7006-1-git-send-email-galak@kernel.crashing.org> References: <1289854274-7006-1-git-send-email-galak@kernel.crashing.org> Message-ID: <201011151652.54361.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, November 15, 2010 15:51:14 Kumar Gala wrote: > returns memory ack to sbrk() via malloc_trim we could possible get "ack" -> "back" > The following code problems an example test to show the issue. i dont understand this sentence > we > could possible get non-zero'd memory from sbrk() if it allocates back > memory that was previously freed to it. > > There are two possible solutions to this problem. > 1. change #define MORECORE_CLEARS 0 > 2. memset to zero memory returned to sbrk. > > We go with the second since the sbrk being called to free up memory > should be pretty rare. > > The following code problems an example test to show the issue. This > test code was inserted right after the call to mem_malloc_init(). this looks like the changelog is partially duplicated -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20101115/1238cc42/attachment.pgp