Re: malloc vs g_malloc
- From: "Tara M" <learfox furry ao net>
- To: "LIST: GTKAppDevel" <gtk-app-devel-list gnome org>
- Subject: Re: malloc vs g_malloc
- Date: 02 Aug 2001 13:25:59 PDT
On 02 Aug 2001 11:56:34 -0400, Havoc Pennington said:
> Is it possible to mix g_malloc (e.g. g_strdup_printf()) and then a normal
> free() instead of a g_free() ?
>
> I do mix them in my application and it seems to be ok under linux, but maybe
> this could be the reason for the instability under Solaris, etc.
>
> Could it be?
>
It is not allowed, no. It does work by default, because by default
g_malloc() is a malloc() wrapper.
But in principle g_malloc()/g_free() must always be paired, they may
be a different allocator from plain malloc().
What about calloc()? is there a glib equivilent for that?
Also what about gtk_*() function returns that give pointers
that need to be deallocated, do we use g_free() or free()?
--
--
Sincerely, ,"-_ \|/
-Capt. Taura M. , O=__ --X--
.__ ,_JNMNNEO=_ /|\
OMNOUMmnne. {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn. 'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe. "7OMMMMNNNNNWWEEEEOOOOOO" "'.
EEBNNMMMNWNWWEEIMMNe. __ 7EMMMNNNNNWWWEEEEEEEOO. " .
NNMMMMWWWMMMWEINMMMNn "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._ .
http://furry.ao.net/~learfox/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]