Re: [gtk-list] Re: how can I trust glib when it has so manymemleaks?



>>>>> "Ionutz" == Ionutz Borcoman <borco@borco-ei.eng.hokudai.ac.jp> writes:

Ionutz> Please detail one thing here: memory is alocated by my program
Ionutz> using glib. You say UNIX will free all the memory. Why isn't
Ionutz> it freeing the memory allocated by glib also ? What is the use
Ionutz> of ccmalloc if memory is freed by system when my program
Ionutz> finishes ? Just to ensure that my program doesn't grow too
Ionutz> much while running ?

>From reading your first message I had the impression that you were
confusing Windows DLL behaviour with Unix.  After reading this far, I
am sure that is the case.

Under Windows, a DLL can allocate some memory on behalf of a process
*and* retain ownership of that memory.  When the program exits, the
DLL must make sure that it frees memory that it allocated on behalf of
that program (if appropriate).

Under Unix, all memory allocated belongs to the process, regardless of
whether it was allocated by a shared library or not.  When the process
terminates, the kernel returns all memory used by that process to the
system.  The only exception to this is SYSV IPC stuff like shared
memory segments.

Hope this clears things up.

- Dave



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]