Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2005 02:55:20 -0700 (PDT)
From:      Simeon Nifos <archwndas@yahoo.com>
To:        freebsd-amd64@freebsd.org
Subject:   memory allocation / initialization of allocated memory
Message-ID:  <20050515095520.68575.qmail@web61113.mail.yahoo.com>
In-Reply-To: <20050513120029.E720816A4DB@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dear list,
I just encountered something which may cause problems 
to debugging memory allocation. You see I had a C code
with a lot of memory allocation/deallocation
instructions
and indirect addressing. Unfortunately I had 3 bugs 
there. Running under Linux the compiler reported 

*** glibc detected *** free(): invalid pointer:
0x08056aa8 ***

This was not however the case with FreeBSD 4.11,
5.4 which didn't have a problem. Testing a simple
program which allocates doubles and/or ints I realized
that FreeBSD automatically initializes to zero the
memory which is allocated by malloc. This is default 
behaviour I guess and I hope that it can be changed.
Otherwise we have problems tracking memory allocation
errors in buggy code. 

Could somebody let me know how to change this default 
behaviour?

Thanks in advance!
Symeon!




		
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050515095520.68575.qmail>