diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-11-05 21:46:15 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-11-05 21:46:15 +0100 |
commit | 66b99a27c644f2bbfbc2feda679415ce80c77a62 (patch) | |
tree | eddfe072b1190d721c007b732664fc5f1795054e /mach-defpager/kalloc.c | |
parent | 6d7787b87860463038da9ddf4dfa393f103091ff (diff) |
mach-defpager: Declare `__malloc_initialize_hook' as volatile.
* mach-defpager/kalloc.c (__MALLOC_HOOK_VOLATILE): New macro.
Diffstat (limited to 'mach-defpager/kalloc.c')
-rw-r--r-- | mach-defpager/kalloc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c index 28c0b55e..5d91aceb 100644 --- a/mach-defpager/kalloc.c +++ b/mach-defpager/kalloc.c @@ -40,7 +40,13 @@ static void init_hook (void); static void *malloc_hook (size_t size, const void *caller); static void free_hook (void *ptr, const void *caller); -void (*__malloc_initialize_hook) (void) = init_hook; +/* GNU libc 2.14 defines this macro to declare hook variables as volatile. + Define it as empty for older libc versions. */ +#ifndef __MALLOC_HOOK_VOLATILE +# define __MALLOC_HOOK_VOLATILE +#endif + +void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void) = init_hook; #define DEBUG |