1 /* vi: set sw=4 ts=4: */
2 /* uClibc internal malloc.
3 Copyright (C) 2007 Denys Vlasenko
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License
7 version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with this library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA.
26 void (*__uc_malloc_failed)(size_t size) = NULL;
27 /* Seemingly superfluous assigment of NULL above prevents gas error
28 * ("__uc_malloc_failed can't be equated to common symbol
29 * __GI___uc_malloc_failed") in libc_hidden_data_def: */
30 libc_hidden_data_def(__uc_malloc_failed)
32 void *__uc_malloc(size_t size)
40 if (!__uc_malloc_failed)
42 __uc_malloc_failed(size);
45 libc_hidden_def(__uc_malloc)