Bug 608196 - Overflow-safe g_new family
authorRyan Lortie <desrt@desrt.ca>
Sun, 7 Mar 2010 04:21:27 +0000 (23:21 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sun, 7 Mar 2010 04:21:27 +0000 (23:21 -0500)
commita1b9743e1816c5269029e8ae2e21e8950c411f5c
treecedcaf83e0eb11c21b76b0d8ca3e553fb59f0e25
parent01ef92178b9978b7491bbb3397de9ee08e38af20
Bug 608196 - Overflow-safe g_new family

Remove the macros for the g_malloc_n family -- calls directly to those
functions now always go directly to those functions.

Reimplement the macros for g_new and friends.

Remove the branch that checked for calling g_new() with a constant
n_structs == 1.  With the struct size always known this case will now be
caught under the case that does the inline multiplication and the
multiplication by 1 will be optimised away.
glib/gmem.c
glib/gmem.h