From: Vik Heyndrickx Newsgroups: comp.os.msdos.djgpp Subject: Re: question to malloc and free Date: Fri, 28 Aug 1998 14:56:20 +0200 Organization: University of Ghent, Belgium Lines: 19 Message-ID: <35E6A8F4.1D40@rug.ac.be> References: NNTP-Posting-Host: eduserv1.rug.ac.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Salvador Eduardo Tropea (SET) wrote: > > califax AT wupperonline DOT de (Klaus Petzold) wrote: > > > when I allocate a memory block with malloc and release it with free, > > how does free know how much it has to release? Stores malloc > > some information about the block? > > Yes malloc stores this information at the beggining of the block. However, treat that information as implementation defined. Some malloc implementations for other platforms store different info at the beginning. Some implementations don't even store anything at all at the beginning of the block. -- \ Vik /-_-_-_-_-_-_/ \___/ Heyndrickx / \ /-_-_-_-_-_-_/ Knight in the Order of the Unsigned Types