Date: Tue, 13 Aug 1996 09:16:16 +0200 (IST) From: Eli Zaretskii To: Leath Muller Cc: Francois Charton , djgpp AT delorie DOT com Subject: Re: Freeing and not freeing Windoze memory In-Reply-To: <199608122323.JAA05799@gbrmpa.gov.au> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 13 Aug 1996, Leath Muller wrote: > > Also, if you do not need too much memory (several kbytes, 10s of kbytes, > > but not 100s of kbytes) you can consider using alloca(), which allocates > > Just a question on this: does DJGPP still allocate memory in powers of 2 > when allocating this way, or does it allocate the size of the structure? No, `alloca' allocates in much smaller increments, like words or dwords. But I don't recommend using it for allocations larger than, say 5KB. That is because your function might be called in a deeply nested program, when some (most) of the stack is already used up. Think about `alloca' as a way to declare a variable-size local array: usually, when the array size gets large, you'd prefer using `malloc' or declare it as a static. The same logic applies to `alloca' IMHO.