Remove all references to the GC library, replacing GC_malloc
authorstevewilliams <stevewilliams@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 3 Feb 2001 00:19:15 +0000 (00:19 +0000)
committerstevewilliams <stevewilliams@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 3 Feb 2001 00:19:15 +0000 (00:19 +0000)
 with calloc. Remove ALLOC_ATOMIC and replace with ALLOC, and
 clean up the Makefile/configure stuff related to libgc.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@568 4a8a32a2-be11-0410-ad9d-d568d2c75423

31 files changed:
Makefile
Makefile.common.in
configure
configure.in
debugger/mcs51/Makefile.in
debugger/mcs51/break.c
debugger/mcs51/sdcdb.c
debugger/mcs51/sdcdb.h
sdcc_vc.h
sdccconf_in.h
src/Makefile.in
src/SDCC.lex
src/SDCC.y
src/SDCCBBlock.c
src/SDCCalloc.h [deleted file]
src/SDCCast.c
src/SDCCbitv.c
src/SDCCglobl.h
src/SDCCglue.c
src/SDCChasht.c
src/SDCChasht.h
src/SDCCmain.c
src/SDCCmem.c
src/SDCCpeeph.c
src/SDCCset.c
src/SDCCset.h
src/SDCCval.c
src/ds390/gen.c
src/mcs51/gen.c
src/z80/gen.c
support/cpp/cppalloc.c

index e24d27060ce8dadd0b2cb61912581640672131b7..9efd710eedec70eb821df8f0f8949d4b0611ddbc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,15 +29,6 @@ all: checkconf sdcc
 tini: checkconf sdcc-tini
 
 sdcc-libs:
-ifeq ($(DISABLE_GC),1)
-       : skip boehm library when disabled by hand.
-else
-ifeq ($(CROSS_LIBGC),1)
-       $(MAKE) -C support/gc -f Makefile.cross
-else
-       $(MAKE) -C support/gc
-endif
-endif
        for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
 
 sdcc-cc: sdcc-libs
index 21371161de57e046659449969bbba9ab96bff291..55bb167f3e75a5c9831b6ffb37ab59f70e4d38e4 100644 (file)
@@ -34,18 +34,8 @@ infodir         = @infodir@
 srcdir          = @srcdir@
 
 # Flags
-HAVE_LIBGC     = @HAVE_LIBGC@
-DISABLE_GC      = @DISABLE_GC@
 DEFS            = $(subs -DHAVE_CONFIG_H,,@DEFS@)
 CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR)
-ifeq ($(DISABLE_GC),1)
-# Skip the Boehm GC library in special, manually configured cases.
-else
-ifeq ($(HAVE_LIBGC),1)
-else
-CPPFLAGS       += -I$(PRJDIR)/support
-endif
-endif
 CFLAGS          = @CFLAGS@ -Wall
 M_OR_MM         = @M_OR_MM@
 
index fea9739a3d95c002aaf8724f5ee87df04dcaaf7b..1b5777908704832c14f20a64b299d0eb88e3ff4b 100755 (executable)
--- a/configure
+++ b/configure
@@ -19,8 +19,6 @@ ac_help="$ac_help
 --disable-mcs51-port: Excludes the Intel mcs51 port"
 ac_help="$ac_help
 --disable-avr-port: Excludes the AVR port"
-ac_help="$ac_help
---disable-boehm-gc: Excludes sdcc use of libgc."
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -538,7 +536,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:542: checking for $ac_word" >&5
+echo "configure:540: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -569,7 +567,7 @@ done
 
 
 echo $ac_n "checking version of the package""... $ac_c" 1>&6
-echo "configure:573: checking version of the package" >&5
+echo "configure:571: checking version of the package" >&5
 if test -f .version; then
   VERSION=`cat .version`
 elif test -f ../.version; then
@@ -611,7 +609,7 @@ sdcc_cv_versionp=$VERSIONP
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:615: checking for $ac_word" >&5
+echo "configure:613: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -641,7 +639,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:645: checking for $ac_word" >&5
+echo "configure:643: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -692,7 +690,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:696: checking for $ac_word" >&5
+echo "configure:694: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -724,7 +722,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:726: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -735,12 +733,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 739 "configure"
+#line 737 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -766,12 +764,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:775: checking whether we are using GNU C" >&5
+echo "configure:773: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -780,7 +778,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -799,7 +797,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:803: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:801: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -835,7 +833,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:839: checking for $ac_word" >&5
+echo "configure:837: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -867,7 +865,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:871: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:869: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -878,12 +876,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 882 "configure"
+#line 880 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -909,12 +907,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:913: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:911: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:918: checking whether we are using GNU C++" >&5
+echo "configure:916: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -923,7 +921,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -942,7 +940,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:946: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:944: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -974,7 +972,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:978: checking how to run the C preprocessor" >&5
+echo "configure:976: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -989,13 +987,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 993 "configure"
+#line 991 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1006,13 +1004,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1010 "configure"
+#line 1008 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1023,13 +1021,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1027 "configure"
+#line 1025 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1084,7 +1082,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1088: checking for a BSD compatible install" >&5
+echo "configure:1086: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1139,7 +1137,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1143: checking for $ac_word" >&5
+echo "configure:1141: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1169,7 +1167,7 @@ fi
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1173: checking for $ac_word" >&5
+echo "configure:1171: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1203,7 +1201,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1207: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1205: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1211,7 +1209,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1215 "configure"
+#line 1213 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1222,7 +1220,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1247,7 +1245,7 @@ fi
 # Extract the first word of "bison", so it can be a program name with args.
 set dummy bison; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1251: checking for $ac_word" >&5
+echo "configure:1249: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1277,7 +1275,7 @@ fi
 # Extract the first word of "autoconf", so it can be a program name with args.
 set dummy autoconf; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1281: checking for $ac_word" >&5
+echo "configure:1279: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AUTOCONF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1307,7 +1305,7 @@ fi
 # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1311: checking for $ac_word" >&5
+echo "configure:1309: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1337,7 +1335,7 @@ fi
 # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1341: checking for $ac_word" >&5
+echo "configure:1339: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1387,12 +1385,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 # Checking for header files.
 # ===========================================================================
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1391: checking for ANSI C header files" >&5
+echo "configure:1389: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1396 "configure"
+#line 1394 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1400,7 +1398,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1417,7 +1415,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1421 "configure"
+#line 1419 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1435,7 +1433,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1439 "configure"
+#line 1437 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1456,7 +1454,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1460 "configure"
+#line 1458 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1467,7 +1465,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1494,17 +1492,17 @@ for ac_hdr in getopt.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1498: checking for $ac_hdr" >&5
+echo "configure:1496: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1503 "configure"
+#line 1501 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1534,17 +1532,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1538: checking for $ac_hdr" >&5
+echo "configure:1536: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1543 "configure"
+#line 1541 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1574,17 +1572,57 @@ for ac_hdr in endian.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1578: checking for $ac_hdr" >&5
+echo "configure:1576: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1581 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in malloc.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1616: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1583 "configure"
+#line 1621 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1614,17 +1652,17 @@ for ac_hdr in sys/isa_defs.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1618: checking for $ac_hdr" >&5
+echo "configure:1656: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1623 "configure"
+#line 1661 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1654,17 +1692,17 @@ for ac_hdr in sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1658: checking for $ac_hdr" >&5
+echo "configure:1696: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1663 "configure"
+#line 1701 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1695,12 +1733,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1699: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1737: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1704 "configure"
+#line 1742 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1708,7 +1746,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -1733,7 +1771,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1737: checking for opendir in -ldir" >&5
+echo "configure:1775: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1741,7 +1779,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1745 "configure"
+#line 1783 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1752,7 +1790,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1774,7 +1812,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1778: checking for opendir in -lx" >&5
+echo "configure:1816: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1782,7 +1820,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1786 "configure"
+#line 1824 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1793,7 +1831,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1819,13 +1857,13 @@ fi
 # This must be after CPP
 
 echo $ac_n "checking which header file defines FD_ macros""... $ac_c" 1>&6
-echo "configure:1823: checking which header file defines FD_ macros" >&5
+echo "configure:1861: checking which header file defines FD_ macros" >&5
 if eval "test \"`echo '$''{'s51_cv_fd'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   sdcc_cv_fd="unknown"
 cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 1867 "configure"
 #include "confdefs.h"
 
 #include <sys/time.h>
@@ -1841,7 +1879,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 1845 "configure"
+#line 1883 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -1857,7 +1895,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 1861 "configure"
+#line 1899 "configure"
 #include "confdefs.h"
 
 #include <sys/select.h>
@@ -1937,12 +1975,12 @@ EOF
 for ac_func in strlen strcpy strcat strstr strcmp strerror strtok strdup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1941: checking for $ac_func" >&5
+echo "configure:1979: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
+#line 1984 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1965,7 +2003,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1992,12 +2030,12 @@ done
 for ac_func in strchr memcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1996: checking for $ac_func" >&5
+echo "configure:2034: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2001 "configure"
+#line 2039 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2020,7 +2058,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2047,12 +2085,12 @@ done
 for ac_func in fgets
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2051: checking for $ac_func" >&5
+echo "configure:2089: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2056 "configure"
+#line 2094 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2075,7 +2113,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2102,12 +2140,12 @@ done
 for ac_func in yylex
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2106: checking for $ac_func" >&5
+echo "configure:2144: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2111 "configure"
+#line 2149 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2130,7 +2168,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2158,14 +2196,14 @@ done
 # check if -lsocket && -lxnet is required to compile socket stuff
 
 echo $ac_n "checking for library containing socket""... $ac_c" 1>&6
-echo "configure:2162: checking for library containing socket" >&5
+echo "configure:2200: checking for library containing socket" >&5
 if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_socket="no"
 cat > conftest.$ac_ext <<EOF
-#line 2169 "configure"
+#line 2207 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2176,7 +2214,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socket="none required"
 else
@@ -2187,7 +2225,7 @@ rm -f conftest*
 test "$ac_cv_search_socket" = "no" && for i in socket; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2191 "configure"
+#line 2229 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2198,7 +2236,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socket="-l$i"
 break
@@ -2220,14 +2258,14 @@ else :
 fi
 
 echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
-echo "configure:2224: checking for library containing inet_addr" >&5
+echo "configure:2262: checking for library containing inet_addr" >&5
 if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_inet_addr="no"
 cat > conftest.$ac_ext <<EOF
-#line 2231 "configure"
+#line 2269 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2238,7 +2276,7 @@ int main() {
 inet_addr()
 ; return 0; }
 EOF
-if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_inet_addr="none required"
 else
@@ -2249,7 +2287,7 @@ rm -f conftest*
 test "$ac_cv_search_inet_addr" = "no" && for i in nsl xnet; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2253 "configure"
+#line 2291 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2260,7 +2298,7 @@ int main() {
 inet_addr()
 ; return 0; }
 EOF
-if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_inet_addr="-l$i"
 break
@@ -2294,7 +2332,7 @@ fi
 # Checking characteristics of compilers and other programs
 # --------------------------------------------------------
 echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6
-echo "configure:2298: checking whether preprocessor accepts -MM or -M" >&5
+echo "configure:2336: checking whether preprocessor accepts -MM or -M" >&5
 if eval "test \"`echo '$''{'sdcc_cv_MM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2316,7 +2354,7 @@ M_OR_MM=$sdcc_cv_MM
 # This is the first time when CFLAGS are set/modified!!
 
 echo $ac_n "checking whether $CC accepts -ggdb""... $ac_c" 1>&6
-echo "configure:2320: checking whether $CC accepts -ggdb" >&5
+echo "configure:2358: checking whether $CC accepts -ggdb" >&5
 if eval "test \"`echo '$''{'sdcc_cv_CCggdb'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2341,7 +2379,7 @@ fi
 
 
 echo $ac_n "checking whether $CC accepts -pipe""... $ac_c" 1>&6
-echo "configure:2345: checking whether $CC accepts -pipe" >&5
+echo "configure:2383: checking whether $CC accepts -pipe" >&5
 if eval "test \"`echo '$''{'sdcc_cv_CCpipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2368,12 +2406,12 @@ fi
 # Checks for typedefs, structures, and compiler characteristics.
 # ===========================================================================
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2372: checking return type of signal handlers" >&5
+echo "configure:2410: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2377 "configure"
+#line 2415 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2390,7 +2428,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2467,48 +2505,6 @@ cat >> confdefs.h <<EOF
 EOF
 
 
-# mlh: dont compile libgc if it's available locally
-echo $ac_n "checking for GC_malloc in -lgc""... $ac_c" 1>&6
-echo "configure:2473: checking for GC_malloc in -lgc" >&5
-ac_lib_var=`echo gc'_'GC_malloc | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2481 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char GC_malloc();
-
-int main() {
-GC_malloc()
-; return 0; }
-EOF
-if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  HAVE_LIBGC=1
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
 
 # Now handle the port selection
 # Check whether --enable-z80-port or --disable-z80-port was given.
@@ -2583,27 +2579,6 @@ EOF
 
 fi
 
-# Check whether --enable-boehm-gc or --disable-boehm-gc was given.
-if test "${enable_boehm_gc+set}" = set; then
-  enableval="$enable_boehm_gc"
-  :
-fi
-
-
-if test "$enable_boehm_gc" = "no"; then
-    cat >> confdefs.h <<\EOF
-#define OPT_DISABLE_GC 1
-EOF
-
-    DISABLE_GC=1
-else
-    cat >> confdefs.h <<\EOF
-#define OPT_DISABLE_GC 0
-EOF
-
-    DISABLE_GC=0
-fi
-
 # Generating output files
 # ===========================================================================
 subdirs="sim/ucsim"
@@ -2715,8 +2690,6 @@ ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
 trap 'rm -fr `echo "main.mk:main_in.mk
-support/gc/Makefile
-support/gc/Makefile.cross
 src/Makefile
 as/mcs51/Makefile
 support/cpp/Makefile
@@ -2775,8 +2748,6 @@ s%@AUTOCONF@%$AUTOCONF%g
 s%@AS@%$AS%g
 s%@CP@%$CP%g
 s%@M_OR_MM@%$M_OR_MM%g
-s%@HAVE_LIBGC@%$HAVE_LIBGC%g
-s%@DISABLE_GC@%$DISABLE_GC%g
 s%@subdirs@%$subdirs%g
 
 CEOF
@@ -2820,8 +2791,6 @@ EOF
 cat >> $CONFIG_STATUS <<EOF
 
 CONFIG_FILES=\${CONFIG_FILES-"main.mk:main_in.mk
-support/gc/Makefile
-support/gc/Makefile.cross
 src/Makefile
 as/mcs51/Makefile
 support/cpp/Makefile
index b3c478a3ac29a5d7f98c105efbac9de56ec095c5..1443114dd0f16b6e6b40f71fbc37916de724dd7d 100755 (executable)
@@ -60,6 +60,7 @@ AC_HEADER_STDC
 AC_CHECK_HEADERS(getopt.h)
 AC_CHECK_HEADERS(unistd.h)
 AC_CHECK_HEADERS(endian.h)
+AC_CHECK_HEADERS(malloc.h)
 AC_CHECK_HEADERS(sys/isa_defs.h)
 AC_CHECK_HEADERS(sys/socket.h)
 AC_HEADER_DIRENT
@@ -199,9 +200,6 @@ AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
 AC_DEFINE_UNQUOTED(DATADIR, "${sdcc_datadir}")
 AC_DEFINE_UNQUOTED(SRCDIR, "${config_in}")
 
-# mlh: dont compile libgc if it's available locally
-AC_CHECK_LIB(gc,GC_malloc,HAVE_LIBGC=1)
-AC_SUBST(HAVE_LIBGC)
 
 # Now handle the port selection
 AC_ARG_ENABLE(z80-port,--disable-z80-port: Excludes the z80 port)
@@ -232,16 +230,6 @@ else
     AC_DEFINE_UNQUOTED(OPT_DISABLE_AVR, 0)
 fi
 
-AC_ARG_ENABLE(boehm-gc,--disable-boehm-gc: Excludes sdcc use of libgc.)
-AC_SUBST(DISABLE_GC,1)
-if test "$enable_boehm_gc" = "no"; then
-    AC_DEFINE(OPT_DISABLE_GC, 1)
-    DISABLE_GC=1
-else
-    AC_DEFINE(OPT_DISABLE_GC, 0)
-    DISABLE_GC=0
-fi
-
 # Generating output files
 # ===========================================================================
 AC_CONFIG_SUBDIRS(sim/ucsim)
@@ -250,8 +238,6 @@ AC_CONFIG_SUBDIRS(packihx)
 #as/z80/Makefile
 #link/z80/Makefile
 AC_OUTPUT(main.mk:main_in.mk
-support/gc/Makefile
-support/gc/Makefile.cross
 src/Makefile
 as/mcs51/Makefile
 support/cpp/Makefile
index f48de5054764a5334b162836b38ebc09ca95182b..14cfd30ccd67b1d068ffa04eb4374c266c75f612 100644 (file)
@@ -13,7 +13,6 @@ CPP           = @CPP@
 INSTALL                = @INSTALL@
 
 PRJDIR         = ../..
-DISABLE_GC     = @DISABLE_GC@
 
 srcdir         = @srcdir@
 prefix         = @prefix@
@@ -33,13 +32,8 @@ CFLAGS               = @CFLAGS@
 M_OR_MM                = @M_OR_MM@
 LDFLAGS                = @LDFLAGS@
 
-ifeq ($(DISABLE_GC),1)
 LIBS            = @LIBS@
 LIBDIRS         =
-else
-LIBS            = -lgc @LIBS@
-LIBDIRS         = -L$(PRJDIR)/support/gc
-endif
 
 
 OBJECTS                = sdcdb.o symtab.o simi.o $(PRJDIR)/src/SDCCset.o \
@@ -54,9 +48,6 @@ TARGET                = $(PRJDIR)/bin/sdcdb
 # ------------------------------------------
 all: checkconf $(TARGET)
 
-$(PRJDIR)/support/gc/libgc.a:
-       cd $(PRJDIR)/support/gc && $(MAKE)
-
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
index 6e85b04b4c07a6454e13e7f8441ab2055ca5d1f4..3ba14a652188e975138dd660b226482dd3dba0a6 100644 (file)
@@ -103,7 +103,7 @@ void deleteSTEPbp ()
            if (hTabSearch(bptable,bp->addr) == NULL) 
                simClearBP (bp->addr);      
 
-           GC_free(bp);
+           free(bp);
        }
     }
   
@@ -133,7 +133,7 @@ void deleteNEXTbp ()
                
            }       
            
-           GC_free(bp);
+           free(bp);
        }
     }
 
index 423e37eb94f457cce71718912391ce0d1989ab90..ef85f5bb325e3cfaa2dceb502538457ba66de9b3 100644 (file)
@@ -183,9 +183,9 @@ void **resize (void **array, int newSize)
     void **vptr;
 
     if (array)
-       vptr = GC_realloc(array,newSize*(sizeof(void **)));
+       vptr = realloc(array,newSize*(sizeof(void **)));
     else
-       vptr = GC_malloc(sizeof(void **));
+       vptr = calloc(1, sizeof(void **));
     
     if (!vptr) {
        fprintf(stderr,"sdcdb: out of memory \n");
index 84fe88c764463fdc78b1e56685ca6ff71ebb03fb..c3bc3c206e4cb170a4cef7ea5531ecec35dc218b 100644 (file)
@@ -32,7 +32,6 @@
 #include <ctype.h>
 #include <limits.h>
 #include "sdccconf.h"
-#include "src/SDCCalloc.h"
 #include "src/SDCCset.h"
 #include "src/SDCChasht.h"
 
@@ -50,14 +49,14 @@ typedef short bool;
 #endif
 
 #ifndef ALLOC
-#define  ALLOC(x,sz) if (!(x = GC_malloc(sz)))                          \
+#define  ALLOC(x,sz) if (!(x = calloc(1, sz)))                          \
          {                                                           \
             fprintf(stderr,"sdcdb: out of memory\n"); \
             exit (1);                                                \
          }
 #endif
 #ifndef ALLOC_ATOMIC
-#define ALLOC_ATOMIC(x,sz)   if (!(x = GC_malloc_atomic(sz)))   \
+#define ALLOC_ATOMIC(x,sz)   if (!(x = calloc(1, sz)))   \
          {                                               \
             fprintf(stderr,"sdcdb: out of memory\n"); \
             exit (1);                                    \
index 1257a016c0bd1df593856c15ee05b10364f7e3a7..0677a76e5c6dbb3fa96f75780260369dfb4a5224 100644 (file)
--- a/sdcc_vc.h
+++ b/sdcc_vc.h
@@ -33,8 +33,6 @@
 #undef OPT_DISABLE_MCS51
 #undef OPT_DISABLE_AVR
 
-#define OPT_DISABLE_GC                 1
-
 #endif
 
 /* End of config.h */
index d8cebd489fc1ff8cc8a405d359e8b7092e718455..70ca5cfc7958b8befbf0786683868bf739cce454 100644 (file)
@@ -32,7 +32,6 @@
 #undef OPT_DISABLE_GBZ80
 #undef OPT_DISABLE_MCS51
 #undef OPT_DISABLE_AVR
-#undef OPT_DISABLE_GC
 
 #endif
 
index c4a1a0265ffb5514d00de081e7fe9b187a814486..a2c567ae7771dfc970fdd50673476c13d8c44a73 100644 (file)
@@ -11,16 +11,7 @@ USE_ALT_LEX  = 0
 PORTS          = mcs51 z80 avr ds390 pic izt
 PORT_LIBS      = $(PORTS:%=%/port.a)
 
-ifeq ($(DISABLE_GC),1)
 LIBS           = -lm @LIBS@
-else
-LIBS           = -lgc -lm @LIBS@
-ifeq ($(HAVE_LIBGC), 1)
-else
-LIBDIRS                = -L$(PRJDIR)/support/gc
-LIBGC          = $(PRJDIR)/support/gc/libgc.a
-endif
-endif
 
 #CFLAGS          += -Werror
 
index a39f0c4fef4b5030a5967efa26c7dc6c9d93e65b..edd42cf00205ed85f7ea059a609a8e7a2828d508 100644 (file)
@@ -262,7 +262,7 @@ int checkCurrFile ( char *s)
        /* mark the end of the filename */
        while (*s != '"') s++;
        *s = '\0';
-       ALLOC_ATOMIC(currFname,strlen(sb)+1);
+       ALLOC(currFname,strlen(sb)+1);
        strcpy(currFname,sb);
        yylineno = lNum - 2;
     }
index 64fc3594eb7bf0970a46de09e6ba4eb941b4d839..8dd9d97b149b968169b419fb3f7cbb033b1c6b4b 100644 (file)
@@ -1113,7 +1113,7 @@ statement
    | jump_statement
    | INLINEASM  ';'      {
                             ast *ex = newNode(INLINEASM,NULL,NULL);
-                           ALLOC_ATOMIC(ex->values.inlineasm,strlen($1));
+                           ALLOC(ex->values.inlineasm,strlen($1));
                            strcpy(ex->values.inlineasm,$1);                        
                            $$ = ex;
                          }   
index 4d40389cd3ba9f6231c849605335894d55292157..5d975e5f25e44e0ad85af0429905ef2cb8a86d51 100644 (file)
@@ -400,12 +400,15 @@ eBBlock **iCodeBreakDown (iCode *ic, int *count)
        /* put it in the array */
        ebbs[(*count)++] = ebb ;
        
-       /* allocate for the next one */
-       if (!(ebbs = GC_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
+         /* allocate for the next one. Remember to clear the new */
+         /*  pointer at the end, that was created by realloc. */
+       if (!(ebbs = realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
            werror(E_OUT_OF_MEM,__FILE__,(*count + 1)*sizeof(eBBlock **)); 
            exit (1);
        }
-       
+
+       ebbs[*count] = 0;
+
        /* if this one ends in a goto or a conditional */
        /* branch then check if the block it is going  */
        /* to already exists, if yes then this could   */
@@ -442,10 +445,11 @@ eBBlock **iCodeBreakDown (iCode *ic, int *count)
                
                (*count)++ ;
                /* if we have stopped at the block , allocate for an extra one */
-               if (!(ebbs = GC_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
+               if (!(ebbs = realloc(ebbs,(*count + 1)*sizeof(eBBlock **)))) {
                    werror(E_OUT_OF_MEM,__FILE__,(*count + 1)*sizeof(eBBlock **)); 
                    exit (1);
                }
+               ebbs[*count] = 0;
                
                /* then move the block down one count */  
                pBlock = ebbs[j = i];
diff --git a/src/SDCCalloc.h b/src/SDCCalloc.h
deleted file mode 100644 (file)
index c0d71f8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#ifndef _SDCCalloc_H
-#define _SDCCalloc_H
-
-#include "SDCCerr.h"
-
-#if OPT_DISABLE_GC != 0
-
-# include <malloc.h>
-# define GC_malloc(x) calloc((x), 1)
-# define GC_free(x)   free(x)
-# define GC_realloc   realloc
-# define GC_malloc_atomic malloc
-
-#else
-
-#include "./gc/gc.h" 
-
-#endif
-
-
-#define  ALLOC(x,sz) if (!(x = GC_malloc(sz)))      \
-         {                                          \
-            werror(E_OUT_OF_MEM,__FILE__,(long) sz);\
-            exit (1);                               \
-         }
-
-#define ALLOC_ATOMIC(x,sz)   if (!(x = GC_malloc_atomic(sz)))   \
-         {                                               \
-            werror(E_OUT_OF_MEM,__FILE__,(long) sz);     \
-            exit (1);                                    \
-         }
-
-
-#endif
index 347fcace2493ed239e68fe695f6089cdd259beb5..ff75fff7a9d74e76a945fe2f39d902039cbba8af 100644 (file)
@@ -206,7 +206,7 @@ void copyAstValues (ast *dest,ast *src)
        break ;
        
     case INLINEASM:
-       ALLOC_ATOMIC(dest->values.inlineasm,strlen(src->values.inlineasm));
+       ALLOC(dest->values.inlineasm,strlen(src->values.inlineasm));
        strcpy(dest->values.inlineasm,src->values.inlineasm);
 
     case FOR:
index c75f7389cb5232c4c4f02083c69d8e19e539efe1..fe8e1b603a6b5872e2fbab72465260ddfe77baef 100644 (file)
@@ -65,7 +65,7 @@ bitVect *bitVectResize (bitVect *bvp, int size)
 
     bvp->size = size;
     bvp->bSize= bSize;
-    bvp->vect = GC_realloc(bvp->vect, bSize);
+    bvp->vect = realloc(bvp->vect, bSize);
     return bvp;
 }
 
index 1c05ec56807083ecc6bf3fd129764da9dcc7a73f..96f760dbabc778b48a61b3fdfdf62646e706b05d 100644 (file)
@@ -27,8 +27,6 @@
 #define NATIVE_WIN32           1
 #endif
 
-# include  "SDCCalloc.h"
-
 #define SPACE ' '
 #define ZERO  0
 
@@ -90,9 +88,16 @@ typedef int bool;
     type *type##FreeStack [size]  ; \
     int   type##StackPtr = 0      ;
 
-#define ALLOCTYPE(type,size) if (!(type##Pool = GC_malloc(size*sizeof(type))))   \
+#define  ALLOC(x,sz) if (!(x = calloc(1, sz)))      \
+         {                                          \
+            werror(E_OUT_OF_MEM,__FILE__,(long) sz);\
+            exit (1);                               \
+         }
+
+
+#define ALLOCTYPE(type,size) if (!(type##Pool = calloc(1, size*sizeof(type))))\
          {                                                            \
-            werror(E_OUT_OF_MEM,__FILE__,(long) size);                          \
+            werror(E_OUT_OF_MEM,__FILE__,(long) size);               \
             exit (1);                                                \
          }
 
index f07bcb74446f4178ccc16de54bae0a2dd3091884..3cd5c434c72075cc38808ca87d78ed912d60a570 100644 (file)
@@ -121,7 +121,7 @@ char *aopLiteralLong(value *val, int offset, int size)
            /* Hmm.  Too big for now. */
            assert(0);
        }
-        ALLOC_ATOMIC(rs,strlen(buffer)+1);
+        ALLOC(rs,strlen(buffer)+1);
         return strcpy (rs,buffer);
     }
 
@@ -135,7 +135,7 @@ char *aopLiteralLong(value *val, int offset, int size)
 #else
     tsprintf(buffer, "!immedbyte", fl.c[offset]);
 #endif
-    ALLOC_ATOMIC(rs,strlen(buffer)+1);
+    ALLOC(rs,strlen(buffer)+1);
     return strcpy (rs,buffer);
 }
 
@@ -1375,7 +1375,7 @@ FILE *tempfile(void)
 char *gc_strdup(const char *s)
 {
     char *ret;
-    ALLOC_ATOMIC(ret, strlen(s)+1);
+    ALLOC(ret, strlen(s)+1);
     strcpy(ret, s);
     return ret;
 }
index d083faa3b2460551a83f63161f8382cd51e6c31d..9703326569f3e1a24a673f58fbb6f5f2e77f91b4 100644 (file)
@@ -56,7 +56,7 @@ hTab *newHashTable (int size)
     
     ALLOC(htab,sizeof(hTab));  
 
-    if (!(htab->table = GC_malloc((size +1)* sizeof(hashtItem *)))) {
+    if (!(htab->table = calloc((size +1),  sizeof(hashtItem *)))) {
        fprintf(stderr,"out of virtual memory %s %d\n",
                __FILE__,(size +1)* sizeof(hashtItem *)); 
        exit(1);
@@ -76,8 +76,8 @@ void hTabAddItemLong(hTab **htab, int key, void *pkey, void *item)
     
     if (key > (*htab)->size ) {        
        int i;       
-       (*htab)->table = GC_realloc ((*htab)->table, 
-                                    (key*2 + 2)*sizeof(hashtItem *));
+       (*htab)->table = realloc ((*htab)->table, 
+                                 (key*2 + 2)*sizeof(hashtItem *));
        for ( i = (*htab)->size +1; i <= (key*2 + 1); i++ )
            (*htab)->table[i] = NULL ;
        (*htab)->size = key*2 + 1;
@@ -174,12 +174,12 @@ void hTabDeleteAll(hTab * p)
            if (!(jc = p->table[i])) continue;
            jn = jc->next; 
            while(jc){ 
-               GC_free(jc);
+               free(jc);
                if((jc=jn)) jn = jc->next;
            } 
            p->table[i] = NULL ;
        }     
-       GC_free(p->table);
+       free(p->table);
     }
 }
 
index 344cab94500d58b352e7ecddec62a81f71c1056b..9422368844192250111b693483b91f8d17635537 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef SDCCHASHT_H
 #define SDCCHASHT_H
 
-#include  "SDCCalloc.h"
 
 
 /* hashtable item */
index 3c53bb8fb1ab67ee11a4150d4914632f60e1cc1b..299cdafe10b3a2d151438d41777721a2f9709e70 100644 (file)
@@ -417,7 +417,7 @@ static void processFile (char *s)
        
        /* get rid of the "." */
        strtok(buffer,".");
-       ALLOC_ATOMIC(srcFileName,strlen(buffer)+1);
+       ALLOC(srcFileName,strlen(buffer)+1);
        strcpy(srcFileName,buffer);
 
        /* get rid of any path information 
@@ -430,7 +430,7 @@ static void processFile (char *s)
               *(fext-1) != '/'   &&
               *(fext-1) != ':')
            fext--;
-       ALLOC_ATOMIC(moduleName,strlen(fext)+1);
+       ALLOC(moduleName,strlen(fext)+1);
        strcpy(moduleName,fext);
        
        return ;
index 3830406544cf0218b771677e3dd849ec4793a33d..3fb5899f047c0aa80ad215287854718aafd3b01d 100644 (file)
@@ -45,7 +45,7 @@ memmap *allocMap (char rspace,     /* sfr space            */
 {
        memmap *map ;
 
-       if (!(map = GC_malloc(sizeof(memmap)))) {
+       if (!(map = calloc(sizeof(memmap), 1))) {
                werror(E_OUT_OF_MEM,__FILE__,sizeof(memmap));
                exit (1);
        }
index b06c6f9e6e52f500754936bca8fbd13f89939c22..9076217726285a60b91dd2503ffcd9a6bc20b3c4 100644 (file)
@@ -276,7 +276,7 @@ peepRule *newPeepRule (lineNode *match  ,
     pr->restart = restart;
 
     if (cond && *cond) {
-    ALLOC_ATOMIC(pr->cond,strlen(cond)+1);
+    ALLOC(pr->cond,strlen(cond)+1);
     strcpy(pr->cond,cond);
     } else
     pr->cond = NULL ;
@@ -300,7 +300,7 @@ lineNode *newLineNode (char *line)
     lineNode *pl;
 
     ALLOC(pl,sizeof(lineNode));
-    ALLOC_ATOMIC(pl->line,strlen(line)+1);
+    ALLOC(pl->line,strlen(line)+1);
     strcpy(pl->line,line);
     return pl;
 }
@@ -506,7 +506,7 @@ static void bindVar (int key, char **s, hTab **vtab)
     *s = vvx ;
     *vv = '\0';
     /* got value */
-    ALLOC_ATOMIC(vvx,strlen(vval)+1);
+    ALLOC(vvx,strlen(vval)+1);
     strcpy(vvx,vval);
     hTabAddItem(vtab,key,vvx);
 
@@ -911,10 +911,10 @@ static char *readFileIntoBuffer (char *fname)
         lb[nch] = '\0';
         /* copy it into allocated buffer */
         if (rs) {
-        rs = GC_realloc(rs,strlen(rs)+strlen(lb)+1);
+        rs = realloc(rs,strlen(rs)+strlen(lb)+1);
         strcat(rs,lb);
         } else {
-        ALLOC_ATOMIC(rs,strlen(lb)+1);
+        ALLOC(rs,strlen(lb)+1);
         strcpy(rs,lb);
         }
         nch = 0 ;
@@ -926,10 +926,10 @@ static char *readFileIntoBuffer (char *fname)
     lb[nch] = '\0';
     /* copy it into allocated buffer */
     if (rs) {
-        rs = GC_realloc(rs,strlen(rs)+strlen(lb)+1);
+        rs = realloc(rs,strlen(rs)+strlen(lb)+1);
         strcat(rs,lb);
     } else {
-        ALLOC_ATOMIC(rs,strlen(lb)+1);
+        ALLOC(rs,strlen(lb)+1);
         strcpy(rs,lb);
     }
     }
index 2b2648bc861466eb8681b183096432eb7b351c0c..f1f039d0386e05026bb8d6e9531f990e6c122e9d 100644 (file)
@@ -23,6 +23,7 @@
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
+#include <malloc.h>
 #include <assert.h>
 #include "SDCCset.h"
 
@@ -33,7 +34,11 @@ set *newSet  ()
 {
   set *lp ;
 
-  ALLOC(lp,sizeof(set)) ;
+  lp = calloc(1, sizeof(set));
+  if (lp == 0) {
+       fprintf(stderr, "out of virtual memory: %s\n", __FILE__);
+       exit(1);
+  }
 
   lp->item = lp->curr= lp->next = NULL;
   return lp;
@@ -498,6 +503,6 @@ void setToNull (void **item )
 
     if (! *item )
        return ;
-    GC_free(*item);  
+    free(*item);  
     *item = NULL ;
 }
index f60664e771026eb6cab92048ff862fcda5c5d975..b5e2ccde84b64a5b2843f7d78296b138ef7dc546 100644 (file)
@@ -32,8 +32,6 @@
 #      include "sdccconf.h"
 #endif         // _MSC_VER
 
-#include "SDCCalloc.h"
-
 
 #ifndef THROWS
 #define THROWS
index 001e121041e0440a7b335c627be7883e1ac15202..644054df96d5300049e5a7540a1d0d12de991ce0 100644 (file)
@@ -402,7 +402,7 @@ value *strVal  ( char       *s )
     SPEC_NOUN(val->etype)   =  V_CHAR   ;
     SPEC_SCLS(val->etype)   =  S_LITERAL;
     
-    ALLOC_ATOMIC(SPEC_CVAL(val->etype).v_char,strlen(s)+1);
+    ALLOC(SPEC_CVAL(val->etype).v_char,strlen(s)+1);
     copyStr (SPEC_CVAL(val->etype).v_char,s);
     return val;
 }
index e2db1f70ae380a45fd4f9d29decde86dbc5d74ed..85cb88d077f6f88e3ff37863242be73fb557e36e 100644 (file)
@@ -36,6 +36,7 @@
 #include <common.h>
 #include "ralloc.h"
 #include "gen.h"
+#include "SDCCglobl.h"
 
 #ifdef HAVE_SYS_ISA_DEFS_H
 #include <sys/isa_defs.h>
@@ -460,7 +461,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
     /* special case for a function */
     if (IS_FUNC(sym->type)) {   
         sym->aop = aop = newAsmop(AOP_IMMD);    
-        ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+        ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
         aop->size = FPTRSIZE; 
         return aop;
@@ -518,7 +519,7 @@ static asmop *aopForRemat (symbol *sym)
     else
        strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
 
-    ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(buffer)+1);
+    ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
     strcpy(aop->aopu.aop_immd,buffer);    
     return aop;        
 }
@@ -889,7 +890,7 @@ static char *aopGet (asmop *aop,
            return (dname ? "acc" : "a");
        }       
        sprintf(s,"@%s",aop->aopu.aop_ptr->name);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -955,7 +956,7 @@ static char *aopGet (asmop *aop,
            else
                sprintf(s,"#%s",
                        aop->aopu.aop_immd);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -966,7 +967,7 @@ static char *aopGet (asmop *aop,
                    offset);
        else
            sprintf(s,"%s",aop->aopu.aop_dir);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
index 1f940d961ddb59754f4973255c52a0a0dd058e73..fe68ff176d236c0d5c930a2744d1dbb461856730 100644 (file)
@@ -353,7 +353,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
     /* special case for a function */
     if (IS_FUNC(sym->type)) {   
         sym->aop = aop = newAsmop(AOP_IMMD);    
-        ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+        ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
         aop->size = FPTRSIZE; 
         return aop;
@@ -400,7 +400,7 @@ static asmop *aopForRemat (symbol *sym)
     else
        strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
 
-    ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(buffer)+1);
+    ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
     strcpy(aop->aopu.aop_immd,buffer);    
     return aop;        
 }
@@ -747,7 +747,7 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
            return (dname ? "acc" : "a");
        }       
        sprintf(s,"@%s",aop->aopu.aop_ptr->name);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -797,7 +797,7 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
            else
                sprintf(s,"#%s",
                        aop->aopu.aop_immd);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -808,7 +808,7 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
                    offset);
        else
            sprintf(s,"%s",aop->aopu.aop_dir);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
index 6ff3ebe852efff857381f65f32af0e6156ef4203..1d95fc8abab0d99b33bb6b0558ef69f659af00da 100644 (file)
@@ -55,6 +55,7 @@
 #endif
 
 #include "z80.h"
+#include "SDCCglobl.h"
 #include "SDCCpeeph.h"
 #include "gen.h"
 #include "SDCCglue.h"
@@ -368,7 +369,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool requires_a)
     /* special case for a function */
     if (IS_FUNC(sym->type)) {   
         sym->aop = aop = newAsmop(AOP_IMMD);    
-        ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+        ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
         aop->size = 2;
         return aop;
@@ -428,7 +429,7 @@ static asmop *aopForRemat (symbol *sym)
         break;
     }
 
-    ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(buffer)+1);
+    ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
     strcpy(aop->aopu.aop_immd,buffer);    
     return aop;        
 }
@@ -715,7 +716,7 @@ char *aopGetLitWordLong(asmop *aop, int offset, bool with_hash)
            tsprintf(s, "!hashedstr + %d", aop->aopu.aop_immd, offset);
        else
            tsprintf(s, "%s + %d", aop->aopu.aop_immd, offset);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
     case AOP_LIT: {
@@ -732,7 +733,7 @@ char *aopGetLitWordLong(asmop *aop, int offset, bool with_hash)
                tsprintf(buffer, "!immedword", v);
            else
                tsprintf(buffer, "!constword", v);
-           ALLOC_ATOMIC(rs,strlen(buffer)+1);
+           ALLOC(rs,strlen(buffer)+1);
            return strcpy (rs,buffer);
        }
        else {
@@ -743,7 +744,7 @@ char *aopGetLitWordLong(asmop *aop, int offset, bool with_hash)
                tsprintf(buffer, "!immedword", f.w[offset/2]);
            else
                tsprintf(buffer, "!constword", f.w[offset/2]);
-           ALLOC_ATOMIC(rs,strlen(buffer)+1);
+           ALLOC(rs,strlen(buffer)+1);
            return strcpy (rs,buffer);
        }
     }
@@ -993,7 +994,7 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
            default:
                wassert(0);
            }
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -1001,7 +1002,7 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
        wassert(IS_GB);
        emitcode("ld", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
        sprintf(s, "a");
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
@@ -1009,7 +1010,7 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
        wassert(IS_GB);
        emitcode("ldh", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
        sprintf(s, "a");
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
 
@@ -1026,7 +1027,7 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
        wassert(IS_Z80);
        setupPair(PAIR_IY, aop, offset);
        tsprintf(s,"!*iyx", offset);
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
 
@@ -1040,7 +1041,7 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
                offset += _G.stack.param_offset;
            tsprintf(s,"!*ixx ; x", aop->aopu.aop_stk+offset);
        }
-       ALLOC_ATOMIC(rs,strlen(s)+1);
+       ALLOC(rs,strlen(s)+1);
        strcpy(rs,s);   
        return rs;
        
index 8e06b98dd4e6f027f19951f8a083604989f4c383..4af9bd94453e49d8e3e823c9ae85337291515b1f 100644 (file)
@@ -23,6 +23,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  what you give them.   Help stamp out software-hoarding!  */
 
 #include "config.h"
+#ifdef HAVE_MALLOC_H
+#include  <malloc.h>
+#endif
 
 static void
 memory_full ()