From mboxrd@z Thu Jan 1 00:00:00 1970 From: lm@mcvoy.com (Larry McVoy) Date: Thu, 10 Sep 2015 13:27:23 -0700 Subject: [TUHS] Did realloc ever zero the new memory? In-Reply-To: <395F25EB-77F3-4830-A1AF-C27E43550C04@kdbarto.org> References: <5962857.12872.1441915841364.JavaMail.root@zimbraanteil> <20150910202115.GH8154@mcvoy.com> <395F25EB-77F3-4830-A1AF-C27E43550C04@kdbarto.org> Message-ID: <20150910202723.GI8154@mcvoy.com> Good, glad to know it wasn't just me. I've finally let my team use it but we avoided it when we supported more odd ball platforms. On zero fill, I doubt many did that. Many really early on when memory was small. What you might be thinking of is modern systems implement malloc() as an mmap of /dev/zero and the initial data comes through as zeroed. But counting on that would be a mistake. On Thu, Sep 10, 2015 at 01:22:33PM -0700, David wrote: > Buggy, sure. > > Zero (less) filling, that is the question. > > Realloc has had a difficult history, and I try to avoid it if at all possible. > > David > > > On Sep 10, 2015, at 1:21 PM, Larry McVoy wrote: > > > > Am I the only one that remembers realloc() being buggy on some systems? -- --- Larry McVoy lm at mcvoy.com http://www.mcvoy.com/lm