mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 10:07:13 +02:00
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.
This commit is contained in:
@@ -37,14 +37,6 @@
|
||||
#include "glib.h"
|
||||
#include "gthreadprivate.h"
|
||||
|
||||
/* Undef the macros before including galias.h */
|
||||
#undef g_malloc_n
|
||||
#undef g_malloc0_n
|
||||
#undef g_realloc_n
|
||||
#undef g_try_malloc_n
|
||||
#undef g_try_malloc0_n
|
||||
#undef g_try_realloc_n
|
||||
|
||||
#include "galias.h"
|
||||
|
||||
#define MEM_PROFILE_TABLE_SIZE 4096
|
||||
|
Reference in New Issue
Block a user