From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stan Shebs To: bfd@cygnus.com Subject: Re: A patch for elf.c Date: Wed, 09 Dec 1998 16:27:00 -0000 Message-id: References: <199812091735.MAA29788@subrogation.cygnus.com> X-SW-Source: 1998/msg00080.html law@hurl.cygnus.com (Jeffrey A Law) writes: > Once one understands precisely why clearing one or more memory locations is > fixing a bug, once can decide if clearing one or more fields or a whole > structure/array is the best solution. > > I believe gdb operates under a similar guidelines. Yes. There is actually a real reason to not just automatically zero everything - in some cases, the blocks are very large, and it's known that they will be overwritten soon, such as when BFD reads in a whole section. So zeroing all allocated blocks chews execution time uselessly. This is just a GNU standard. In my other program (Xconq), everything is zeroed upon allocation, and the rest of the code is designed to exploit that. Stan