Ticket #41124: patch-lib__vmalloc__features__vmalloc-dyld-uses-malloc.diff
File patch-lib__vmalloc__features__vmalloc-dyld-uses-malloc.diff, 628 bytes (added by neverpanic (Clemens Lang), 11 years ago) |
---|
-
lib/vmalloc/features/vmalloc
old new 44 44 #if _hdr_alloca 45 45 #include <alloca.h> 46 46 #endif 47 #include <dlfcn.h> 48 volatile int testing_alloca = 0; 47 49 #if _STD_ 48 50 void* malloc(unsigned int size) 49 51 #else 50 52 void* malloc(size) unsigned int size; 51 53 #endif 52 { exit(0); 54 { if (!testing_alloca) { 55 return ((void *(*)(unsigned int)) dlsym(RTLD_NEXT, "malloc"))(size); 56 } 57 exit(0); 53 58 return 0; 54 59 } 55 60 main() 56 { alloca(10); 61 { testing_alloca = 1; 62 alloca(10); 63 testing_alloca = 0; 57 64 return 1; 58 65 } 59 66 }end