Remove commented-out "support" for perl's malloc with x2p.
authorNicholas Clark <nick@ccl4.org>
Thu, 8 Dec 2011 10:12:25 +0000 (11:12 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 9 Dec 2011 16:09:51 +0000 (17:09 +0100)
In 1998 commit 30e2e4257067d5f8 stated

    temporarily disable perl malloc for a2p until we clean up
    conflicting malloc() declarations everywhere

and nothing has changed since. 13 years later, no-one has reported problems,
so it's safe to remove it.

malloc.c
x2p/Makefile.SH

index 64613ee..60007b5 100644 (file)
--- a/malloc.c
+++ b/malloc.c
 #     define PERL_MAYBE_ALIVE  1
 #  endif
 #else
-#  ifdef PERL_FOR_X2P
-#    include "../EXTERN.h"
-#    include "../perl.h"
-#  else
+
 #    include <stdlib.h>
 #    include <stdio.h>
 #    include <memory.h>
 #    ifndef MEM_ALIGNBYTES
 #      define MEM_ALIGNBYTES           4
 #    endif
-#  endif
+
 #  ifndef croak                                /* make depend */
 #    define croak(mess, arg) (warn((mess), (arg)), exit(1))
 #  endif 
index 800f583..1df26d5 100755 (executable)
@@ -42,9 +42,6 @@ cat >Makefile <<!GROK!THIS!
 CC = $cc
 BYACC = $byacc
 LDFLAGS = $ldflags
-# XXX Perl malloc temporarily unusable (declaration collisions with stdlib.h)
-#mallocsrc = $mallocsrc
-#mallocobj = $mallocobj
 shellflags = $shellflags
 
 libs = $perllibs
@@ -101,9 +98,9 @@ addedbyconf = $(shextract) $(plextract)
 
 h = EXTERN.h INTERN.h ../config.h ../handy.h hash.h a2p.h str.h util.h
 
-c = hash.c $(mallocsrc) str.c util.c walk.c
+c = hash.c str.c util.c walk.c
 
-obj = hash$(OBJ_EXT) $(mallocobj) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT)
+obj = hash$(OBJ_EXT) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT)
 
 lintflags = -phbvxac
 
@@ -156,7 +153,7 @@ distclean: veryclean
 
 realclean: clean
        -rmdir .depending
-       rm -f core $(addedbyconf) all malloc.c
+       rm -f core $(addedbyconf) all
        rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
 
 veryclean: realclean
@@ -170,7 +167,7 @@ veryclean: realclean
 lint:
        lint $(lintflags) $(defs) $(c) > a2p.fuzz
 
-depend: $(mallocsrc) ../makedepend
+depend: ../makedepend
        sh ../makedepend MAKE=$(MAKE)
 
 clist:
@@ -189,14 +186,6 @@ find2perl: find2perl.PL ../config.sh
 
 s2p: s2p.PL ../config.sh
 
-malloc.c: ../malloc.c
-       rm -f malloc.c
-       sed <../malloc.c >malloc.c \
-           -e 's/"EXTERN.h"/"..\/EXTERN.h"/' \
-           -e 's/"perl.h"/"..\/perl.h"/' \
-           -e 's/my_exit/exit/' \
-           -e 's/MUTEX_[A-Z_]*(&PL_malloc_mutex);//'
-
 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
 $(obj):
        @ echo "You haven't done a "'"make depend" yet!'; exit 1