This is the mail archive of the
mailing list for the GCC project.
RE: precompiled header support
- From: "Dave Korn" <dk at artimi dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 12 May 2004 11:42:01 +0100
- Subject: RE: precompiled header support
> -----Original Message-----
> From: Gunther Nikl
> Sent: 12 May 2004 08:55
> > when you know you have to free every malloc because it
> won't get released
> > just because your process exits!).
> That not quite correct. Allocations done through standard C
> (memory, streams) _are_ released as long as the progam
> doesn't bypass
> the cleanup step (eg. by calling _exit()). Its true that
> direct resource
> allocations with OS functions need to be freed explicitly
> because there
> is no resource tracking per process.
Heh, sorry for being slightly vague about it; of course I knew that, but
since the C library isn't an OS component but an addon under Amiga, I think
it's fair to say that your objection is pretty much the same as saying "You
don't have to remember to free every allocation, you just need to allocate
one block and remember to free it once, then use your own heap manager
routines within that block". I guess I shouldn't have used the word
'malloc' when I really meant 'memory allocation'; but bear in mind that even
if you want to say I should be comparing malloc with malloc, then remember
that sbrk'd space also gets freed automatically at process exit and
AllocMem'd space doesn't, so my point still stands!
Can't think of a witty .sigline today....