summaryrefslogtreecommitdiff
path: root/include/malloc.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-30 16:51:48 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-30 16:51:48 +0000
commitdc0bc6941130c89db3d2d7b61479dc2ef9185b5c (patch)
tree0e2283017ec7e33aa8d34c6623cb089140902723 /include/malloc.h
parent519ca27d4a720c900ad74e8018cdd5cc08a8b3a6 (diff)
introduce __uc_malloc, so that users can intercept libc internal OOM.
Diffstat (limited to 'include/malloc.h')
-rw-r--r--include/malloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/malloc.h b/include/malloc.h
index 354f153d4..05eac9fdd 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -183,6 +183,13 @@ extern int mallopt __MALLOC_P ((int __param, int __val));
#endif /* __MALLOC_STANDARD__ */
+/* uClibc may use malloc internally in situations where user can not be
+ * notified about out-of-memory condition. In this situation uClibc will
+ * call __uc_malloc_failed if it is non-NULL, and retry allocation
+ * if it returns. If __uc_malloc_failed is NULL, uclubc will _exit(1).
+ * NB: do not use stdio in __uc_malloc_failed handler! */
+extern void *__uc_malloc(size_t size);
+extern void (*__uc_malloc_failed)(size_t size);
#ifdef __cplusplus
} /* end of extern "C" */