From 25cef5c591fbee755a53f0d7920f4f554f343a53 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 10 Jun 2020 20:44:51 -0400 Subject: reintroduce calloc elison of memset for direct-mmapped allocations a new weak predicate function replacable by the malloc implementation, __malloc_allzerop, is introduced. by default it's always false; the default version will be used when static linking if the bump allocator was used (in which case performance doesn't matter) or if malloc was replaced by the application. only if the real internal malloc is linked (always the case with dynamic linking) does the real version get used. if malloc was replaced dynamically, as indicated by __malloc_replaced, the predicate function is ignored and conditional-memset is always performed. --- src/internal/dynlink.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/internal') diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h index b739add2..78baa080 100644 --- a/src/internal/dynlink.h +++ b/src/internal/dynlink.h @@ -107,5 +107,6 @@ hidden ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic(); hidden extern int __malloc_replaced; hidden void __malloc_donate(char *, char *); +hidden int __malloc_allzerop(void *); #endif -- cgit v1.2.1