usedevel, no otherwise, but I'm expecting hints files on known
good platforms to override this. (and known bad)
Demonstration hints file for darwin.
p4raw-id: //depot/perl@22571
mallocobj=''
mallocsrc=''
malloctype=''
+usemallocwrap=''
usemymalloc=''
installman1dir=''
man1dir=''
;;
esac
+: determine whether to use malloc wrapping
+echo " "
+case "$usemallocwrap" in
+[yY]*|true|$define) dflt='y' ;;
+[nN]*|false|$undef) dflt='n' ;;
+*) case "$usedevel" in
+ [yY]*|true|$define) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
+esac
+rp="Do you wish to wrap malloc calls to protect against potential overflows?"
+. ./myread
+usemallocwrap="$ans"
+case "$ans" in
+y*|true)
+ usemallocwrap="$define" ;;
+*)
+ usemallocwrap="$undef" ;;
+esac
: determine which malloc to compile in
echo " "
mallocobj='$mallocobj'
mallocsrc='$mallocsrc'
malloctype='$malloctype'
+usemallocwrap='$usemallocwrap'
man1dir='$man1dir'
man1direxp='$man1direxp'
man1ext='$man1ext'
*/
#$d_mymalloc MYMALLOC /**/
+/* PERL_MALLOC_WRAP:
+ * This symbol, if defined, indicates that we'd like malloc wrap checks.
+ */
+#$usemallocwrap PERL_MALLOC_WRAP /**/
+
/* CAN_PROTOTYPE:
* If defined, this macro indicates that the C compiler can handle
* function prototypes.
# vfork works
usevfork='true';
+# malloc wrap works
+case "$usemallocwrap" in
+'') usemallocwrap='define' ;;
+esac
+
# our malloc works (but allow users to override)
case "$usemymalloc" in
'') usemymalloc='n' ;;
typedef struct ptr_tbl PTR_TBL_t;
typedef struct clone_params CLONE_PARAMS;
-#ifndef NO_PERL_MALLOC_WRAP
-#define PERL_MALLOC_WRAP /* We'd like malloc wrap checks. */
-#endif
-
#include "handy.h"
#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)