1 /* Compatibility code for malloc debugging and state management.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If
18 not, see <https://www.gnu.org/licenses/>. */
21 # define weak_variable weak_function
24 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_24)
25 void (*__malloc_initialize_hook
) (void);
26 compat_symbol (libc
, __malloc_initialize_hook
,
27 __malloc_initialize_hook
, GLIBC_2_0
);
30 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_34)
31 void weak_variable (*__after_morecore_hook
) (void) = NULL
;
32 compat_symbol (libc
, __after_morecore_hook
, __after_morecore_hook
, GLIBC_2_0
);
33 void *(*__morecore
)(ptrdiff_t);
34 compat_symbol (libc
, __morecore
, __morecore
, GLIBC_2_0
);
36 void weak_variable (*__free_hook
) (void *, const void *) = NULL
;
37 void *weak_variable (*__malloc_hook
) (size_t, const void *) = NULL
;
38 void *weak_variable (*__realloc_hook
) (void *, size_t, const void *) = NULL
;
39 void *weak_variable (*__memalign_hook
) (size_t, size_t, const void *) = NULL
;
40 compat_symbol (libc
, __free_hook
, __free_hook
, GLIBC_2_0
);
41 compat_symbol (libc
, __malloc_hook
, __malloc_hook
, GLIBC_2_0
);
42 compat_symbol (libc
, __realloc_hook
, __realloc_hook
, GLIBC_2_0
);
43 compat_symbol (libc
, __memalign_hook
, __memalign_hook
, GLIBC_2_0
);