Message-ID: <3590F712.DB3C02E0@compmore.net> Date: Wed, 24 Jun 1998 08:54:43 -0400 From: stdenis MIME-Version: 1.0 To: Zixyer S Qwerty CC: djgpp AT delorie DOT com Subject: Re: free() References: <19980623 DOT 131350 DOT 7759 DOT 0 DOT zixyer AT juno DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk > How does free() know how much memory to return to the heap? Does it have > to be the originally malloc()ed pointer or can it be a different pointer > to the memory that was allocated? I'm writing a linked list and keeping > pointers to each element around kinda defeats the purpose... thanks in > advance for any help Well yeah, when you malloc a block, it keeps the pointer, then when you free it it checks the pointer and returns it to the heap Well allocate one big block (for the whole list) and use the block dynamically. tom