User: crestani
Date: 06/02/27 17:29:42
Modified: xemacs/src ChangeLog Makefile.in.in alloc.c buffer.c
bytecode.c bytecode.h config.h.in console-stream.c
console.c dumper.c dumper.h elhash.c emacs.c eval.c
event-msw.c event-stream.c extents.c faces.h
file-coding.c gc.c gc.h glyphs.h gui.c lisp.h
lrecord.h lstream.c marker.c mc-alloc.c mc-alloc.h
opaque.c print.c ralloc.c specifier.c symbols.c
symeval.h symsinit.h tests.c xemacs.def.in.in
Log:
- Introduce a fancy asynchronous finalization strategy on C level.
- Merge the code conditioned on MC_ALLOC into the code conditioned on
NEW_GC.
- Remove the possibility to free objects manually outside garbage
collections when the new collector is enabled.
Revision Changes Path
1.492 +5 -0 XEmacs/xemacs/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/ChangeLog,v
retrieving revision 1.491
retrieving revision 1.492
diff -u -p -r1.491 -r1.492
--- ChangeLog 2006/02/26 13:43:52 1.491
+++ ChangeLog 2006/02/27 16:29:00 1.492
@@ -1,3 +1,8 @@
+2006-02-22 Marcus Crestani <crestani(a)xemacs.org>
+
+ * configure.ac: Remove mc-alloc, replace it with newgc, adjust
+ output and comments.
+
2006-02-26 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.25 "eggplant" is released.
1.273 +7 -38 XEmacs/xemacs/configure
Index: configure
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -p -r1.272 -r1.273
--- configure 2006/02/26 13:43:20 1.272
+++ configure 2006/02/27 16:29:00 1.273
@@ -1174,10 +1174,10 @@ Memory allocation options
--with-pdump Enable portable LISP preloader.
--with-dump-in-exec Enable dumping into executable (enabled by default
for `pdump', not enabled by default in combination
- with `mc-alloc').
- --with-kkcc Enable experimental new GC algorithms.
- --with-mc-alloc Enable experimental new allocator.
- --with-newgc Enable new incremental garbage collector.
+ with `newgc').
+ --with-kkcc Enable experimental new GC mark algorithms.
+ --with-newgc Enable new incremental garbage collector and new
+ allocator.
--with-vdb=TYPE Override auto-detection of virtual-dirty-bit
write-barrier implementation for the new garbage
collector. TYPE must be one of "auto" (for
@@ -3575,24 +3575,7 @@ if test "${with_kkcc+set}" = set; then
else
enable_kkcc=yes
fi;
-# If --with-mc-alloc or --without-mc-alloc were given then copy the value to the
-# equivalent enable_mc-alloc variable.
-if test "${with_mc_alloc+set}" = set; then
- enable_mc_alloc="$with_mc_alloc"
-fi;
-# If -enable-mc-alloc or --disable-mc-alloc were given then copy the value to the
-# equivalent with_mc-alloc variable.
-if test "${enable_mc_alloc+set}" = set; then
- with_mc_alloc="$enable_mc_alloc"
-fi;
-# Check whether --with-mc-alloc or --without-mc-alloc was given.
-if test "${with_mc_alloc+set}" = set; then
- enableval="$with_mc_alloc"
- withval="$with_mc_alloc"
-else
- enable_mc_alloc=yes
-fi;
# If --with-newgc or --without-newgc were given then copy the value to the
# equivalent enable_newgc variable.
if test "${with_newgc+set}" = set; then
@@ -8996,11 +8979,10 @@ if test "$enable_pdump" = "yes"; then
fi
test -z "$enable_kkcc" && enable_kkcc=yes
-test -z "$enable_mc_alloc" && enable_mc_alloc=yes
if test -z "$enable_dump_in_exec"; then
if test "$enable_pdump" = "yes"; then
- if test "$enable_mc_alloc" = "yes"; then
+ if test "$enable_newgc" = "yes"; then
enable_dump_in_exec=no
else
enable_dump_in_exec=yes
@@ -9009,7 +8991,6 @@ if test -z "$enable_dump_in_exec"; then
fi
if test "$enable_newgc" = "yes"; then
- enable_mc_alloc=yes
enable_kkcc=yes
fi
@@ -39163,10 +39144,6 @@ test "$enable_kkcc" = "yes" && ca
#define USE_KKCC 1
_ACEOF
-test "$enable_mc_alloc" = "yes" && cat >>confdefs.h <<\_ACEOF
-#define MC_ALLOC 1
-_ACEOF
-
test "$enable_newgc" = "yes" && cat >>confdefs.h <<\_ACEOF
#define NEW_GC 1
_ACEOF
@@ -39481,22 +39458,14 @@ if test "$enable_union_type" = yes ; the
echo " WARNING: ---------------------------------------------------------"
fi
if test "$enable_kkcc" = yes ; then
- echo " Using the new GC algorithms."
+ echo " Using the new GC mark algorithms (KKCC)."
echo " WARNING: ---------------------------------------------------------"
echo " WARNING: The new algorithms are experimental. They are enabled by"
echo " WARNING: default for this release. Use \`--disable-kkcc' to"
echo " WARNING: turn it off."
echo " WARNING: ---------------------------------------------------------"
-fi
-if test "$enable_mc_alloc" = yes ; then
- echo " Using the new allocator."
- echo " WARNING: ---------------------------------------------------------"
- echo " WARNING: The new allocator is experimental. It is enabled by"
- echo " WARNING: default for this release. Use \`--disable-mc-alloc' to"
- echo " WARNING: turn it off."
- echo " WARNING: ---------------------------------------------------------"
fi
-test "$enable_newgc" = yes && echo " Using the new incremental garbage collector."
+test "$enable_newgc" = yes && echo " Using the new incremental garbage collector and the new allocator."
if test "$have_vdb_posix" = yes ; then
if test "$have_vdb_sigaction" = yes ; then
echo " Using POSIX sigaction() to install fault handler."
1.35 +8 -21 XEmacs/xemacs/configure.ac
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -r1.34 -r1.35
--- configure.ac 2006/02/20 15:58:24 1.34
+++ configure.ac 2006/02/27 16:29:06 1.35
@@ -919,16 +919,14 @@ XE_MERGED_ARG([pdump],
XE_MERGED_ARG([dump-in-exec],
AC_HELP_STRING([--enable-dump-in-exec],[Enable dumping into executable (enabled by default
for `pdump', not enabled by default in combination
- with `mc-alloc').]),
+ with `newgc').]),
[], [])
XE_MERGED_ARG([kkcc],
- AC_HELP_STRING([--enable-kkcc],[Enable experimental new GC algorithms.]),
+ AC_HELP_STRING([--enable-kkcc],[Enable experimental new GC mark algorithms.]),
[], [enable_kkcc=yes])
-XE_MERGED_ARG([mc-alloc],
- AC_HELP_STRING([--enable-mc-alloc],[Enable experimental new allocator.]),
- [], [enable_mc_alloc=yes])
+
XE_MERGED_ARG([newgc],
- AC_HELP_STRING([--enable-newgc],[Enable new incremental garbage collector.]),
+ AC_HELP_STRING([--enable-newgc],[Enable new incremental garbage collector and new allocator.]),
[], [])
XE_COMPLEX_ARG([vdb],
AC_HELP_STRING([--enable-vdb=TYPE],[Override auto-detection of
@@ -2128,14 +2126,13 @@ if test "$enable_pdump" = "yes"; then
lib_gcc=
fi
-dnl Enable KKCC and MC-ALLOC by default
+dnl Enable KKCC by default
test -z "$enable_kkcc" && enable_kkcc=yes
-test -z "$enable_mc_alloc" && enable_mc_alloc=yes
dnl Dump into executable
if test -z "$enable_dump_in_exec"; then
if test "$enable_pdump" = "yes"; then
- if test "$enable_mc_alloc" = "yes"; then
+ if test "$enable_newgc" = "yes"; then
enable_dump_in_exec=no
else
enable_dump_in_exec=yes
@@ -2145,7 +2142,6 @@ fi
dnl New incremental garbage collector
if test "$enable_newgc" = "yes"; then
- enable_mc_alloc=yes
enable_kkcc=yes
fi
@@ -5830,7 +5826,6 @@ fi
test "$GCC" = "yes" && AC_DEFINE(USE_GCC)
test "$enable_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
test "$enable_kkcc" = "yes" && AC_DEFINE(USE_KKCC)
-test "$enable_mc_alloc" = "yes" && AC_DEFINE(MC_ALLOC)
test "$enable_newgc" = "yes" && AC_DEFINE(NEW_GC)
test "$have_vdb_posix" = "yes" && AC_DEFINE(VDB_POSIX)
test "$have_vdb_fake" = "yes" && AC_DEFINE(VDB_FAKE)
@@ -6115,22 +6110,14 @@ if test "$enable_union_type" = yes ; the
echo " WARNING: ---------------------------------------------------------"
fi
if test "$enable_kkcc" = yes ; then
- echo " Using the new GC algorithms."
+ echo " Using the new GC mark algorithms (KKCC)."
echo " WARNING: ---------------------------------------------------------"
echo " WARNING: The new algorithms are experimental. They are enabled by"
echo " WARNING: default for this release. Use \`--disable-kkcc' to"
echo " WARNING: turn it off."
echo " WARNING: ---------------------------------------------------------"
-fi
-if test "$enable_mc_alloc" = yes ; then
- echo " Using the new allocator."
- echo " WARNING: ---------------------------------------------------------"
- echo " WARNING: The new allocator is experimental. It is enabled by"
- echo " WARNING: default for this release. Use \`--disable-mc-alloc' to"
- echo " WARNING: turn it off."
- echo " WARNING: ---------------------------------------------------------"
fi
-test "$enable_newgc" = yes && echo " Using the new incremental garbage collector."
+test "$enable_newgc" = yes && echo " Using the new incremental garbage collector and the new allocator."
if test "$have_vdb_posix" = yes ; then
if test "$have_vdb_sigaction" = yes ; then
echo " Using POSIX sigaction() to install fault handler."
1.199 +5 -0 XEmacs/xemacs/nt/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/ChangeLog,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -p -r1.198 -r1.199
--- ChangeLog 2006/02/26 13:45:21 1.198
+++ ChangeLog 2006/02/27 16:29:16 1.199
@@ -1,3 +1,8 @@
+2006-02-22 Marcus Crestani <crestani(a)xemacs.org>
+
+ * xemacs.mak: Remove mc-alloc, replace with newgc, adjust output.
+ * config.inc.samp: Remove MC_ALLOC option.
+
2006-02-26 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.25 "eggplant" is released.
1.24 +2 -4 XEmacs/xemacs/nt/config.inc.samp
Index: config.inc.samp
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/config.inc.samp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- config.inc.samp 2005/11/25 01:41:50 1.23
+++ config.inc.samp 2006/02/27 16:29:16 1.24
@@ -220,10 +220,8 @@ USE_PORTABLE_DUMPER=1
# of the traditional XEmacs garbage-collection routines.
USE_KKCC=1
-# Set this to use the new experimental allocator routines
-MC_ALLOC=1
-
-# Set this to use the new experimental incremental garbage collector routines
+# Set this to use the new experimental incremental garbage collector
+# and the new allocator routines
NEW_GC=0
# Set this to turn on the use of the union type, which gets you improved
1.120 +4 -15 XEmacs/xemacs/nt/xemacs.mak
Index: xemacs.mak
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/nt/xemacs.mak,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -p -r1.119 -r1.120
--- xemacs.mak 2005/11/25 01:41:50 1.119
+++ xemacs.mak 2006/02/27 16:29:17 1.120
@@ -215,9 +215,6 @@ CPLUSPLUS_COMPILE=0
!if !defined(USE_KKCC)
USE_KKCC=0
!endif
-!if !defined(MC_ALLOC)
-MC_ALLOC=0
-!endif
!if !defined(NEW_GC)
NEW_GC=0
!endif
@@ -644,20 +641,15 @@ OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\unexnt.ob
!if $(NEW_GC)
OPT_DEFINES=$(OPT_DEFINES) -DNEW_GC
-OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\vdb.obj $(OUTDIR)\vdb-win32.obj
+OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\vdb.obj $(OUTDIR)\vdb-win32.obj \
+ $(OUTDIR)\mc-alloc.obj
USE_KKCC=1
-MC_ALLOC=1
!endif
!if $(USE_KKCC)
OPT_DEFINES=$(OPT_DEFINES) -DUSE_KKCC
!endif
-!if $(MC_ALLOC)
-OPT_DEFINES=$(OPT_DEFINES) -DMC_ALLOC
-OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\mc-alloc.obj
-!endif
-
!if $(USE_SYSTEM_MALLOC)
OPT_DEFINES=$(OPT_DEFINES) -DSYSTEM_MALLOC
!else
@@ -1266,13 +1258,10 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs
Disabling non-essential build actions. Use with care!
!endif
!if $(USE_KKCC)
- Using new experimental GC algorithms.
-!endif
-!if $(MC_ALLOC)
- Using new experimental allocator.
+ Using new experimental GC mark algorithms.
!endif
!if $(NEW_GC)
- Using new experimental incremental garbage collector.
+ Using new experimental incremental garbage collector and new allocator.
!endif
<<NOKEEP
@echo --------------------------------------------------------------------
1.925 +75 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.924
retrieving revision 1.925
diff -u -p -r1.924 -r1.925
--- ChangeLog 2006/02/26 13:45:51 1.924
+++ ChangeLog 2006/02/27 16:29:20 1.925
@@ -1,3 +1,78 @@
+2006-02-22 Marcus Crestani <crestani(a)xemacs.org>
+
+ Asynchronous finalization:
+
+ * Makefile.in.in: Remove mc-alloc, replace with newgc.
+ * alloc.c (alloc_lrecord): Add object that has a finalizer
+ to Vall_finalizable_objs.
+ * alloc.c (noseeum_alloc_lrecord): Add object that has a finalizer
+ to Vall_finalizable_objs.
+ * alloc.c (alloc_lrecord_array): Add object that has a finalizer
+ to Vall_finalizable_objs.
+ * alloc.c (free_lrecord): Disable manual free.
+ * dumper.c (pdump_register_object): Objects with finalizers cannot
+ be dumped.
+ * eval.c (Ffuncall): Add call to run_finalizers.
+ * gc.c (finalize_elem): New.
+ * gc.c (add_finalizable_object): New.
+ * gc.c (register_for_finalization): New.
+ * gc.c (gc_finalize): Call register_for_finalization.
+ * gc.c (gc_1): Move kkcc_gc_stack_free after finalization.
+ * gc.c (common_init_gc_early): Add asynchronous finalization
+ variables.
+ * gc.c (init_gc_early): Add asynchronous finalization variables.
+ * gc.c (vars_of_gc): Add asynchronous finalization variables.
+ * gc.h: Add asynchronous finalization prototypes.
+ * mc-alloc.c (finalize_heap): Remove.
+ * mc-alloc.c (mc_free): Disable manual free.
+
+ * elhash.c (finalize_hash_table): Remove unneeded finalizer for
+ NEW_GC
+ * extents.c (finalize_extent_info): Remove unneeded finalizer for
+ NEW_GC.
+ * file-coding.c (finalize_coding_system): Remove unneeded
+ finalizer for NEW_GC.
+ * gui.c (finalize_gui_item): Remove unneeded finalizer.
+ * specifier.c (finalize_specifier): Remove unneeded finalizer for
+ NEW_GC.
+
+ Merge #ifdef MC_ALLOC into #ifdef NEW_GC, remove no longer needed
+ MC_ALLOC specific code in all files:
+ * alloc.c:
+ * buffer.c:
+ * bytecode.c:
+ * bytecode.h:
+ * config.h.in:
+ * console-stream.c:
+ * console.c:
+ * dumper.c:
+ * dumper.h:
+ * elhash.c:
+ * emacs.c:
+ * event-msw.c:
+ * event-stream.c:
+ * extents.c:
+ * extents.c:
+ * faces.h:
+ * file-coding.c:
+ * gc.c:
+ * glyphs.h:
+ * lisp.h:
+ * lrecord.h:
+ * lstream.c:
+ * marker.c:
+ * mc-alloc.c:
+ * mc-alloc.h:
+ * opaque.c:
+ * print.c:
+ * ralloc.c:
+ * specifier.c:
+ * symbols.c:
+ * symeval.h:
+ * symsinit.h:
+ * tests.c:
+ * xemacs.def.in.in:
+
2006-02-26 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.25 "eggplant" is released.
1.124 +2 -6 XEmacs/xemacs/src/Makefile.in.in
Index: Makefile.in.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Makefile.in.in,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -p -r1.123 -r1.124
--- Makefile.in.in 2005/11/26 11:46:06 1.123
+++ Makefile.in.in 2006/02/27 16:29:21 1.124
@@ -254,12 +254,8 @@ win32_objs=win32.o intl-win32.o intl-aut
xemacs_res.o
#endif
-#ifdef MC_ALLOC
-mc_alloc_objs=mc-alloc.o
-#endif
-
#ifdef NEW_GC
-new_gc_objs=vdb.o
+new_gc_objs=mc-alloc.o vdb.o
# if defined (WIN32_ANY) || defined (VDB_WIN32)
vdb_objs=vdb-win32.o
# elif defined (VDB_MACH)
@@ -294,7 +290,7 @@ objs=\
gutter.o\
hash.o imgproc.o indent.o insdel.o intl.o\
keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
- $(mc_alloc_objs) $(new_gc_objs) $(vdb_objs) \
+ $(new_gc_objs) $(vdb_objs) \
macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\
$(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) $(number_objs) objects.o\
opaque.o $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\
1.123 +149 -199 XEmacs/xemacs/src/alloc.c
Index: alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -p -r1.122 -r1.123
--- alloc.c 2005/12/25 11:21:46 1.122
+++ alloc.c 2006/02/27 16:29:21 1.123
@@ -191,13 +191,13 @@ Error_Behavior ERROR_ME, ERROR_ME_NOT, E
void *minimum_address_seen;
void *maximum_address_seen;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
int
c_readonly (Lisp_Object obj)
{
return POINTER_TYPE_P (XTYPE (obj)) && C_READONLY (obj);
}
-#endif /* MC_ALLOC */
+#endif /* not NEW_GC */
int
lisp_readonly (Lisp_Object obj)
@@ -216,7 +216,7 @@ lisp_readonly (Lisp_Object obj)
int ignore_malloc_warnings;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void *breathing_space;
void
@@ -229,7 +229,7 @@ release_breathing_space (void)
xfree (tmp, void *);
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* malloc calls this if it finds we are near exhausting storage */
void
@@ -258,9 +258,9 @@ memory_full (void)
*/
consing_since_gc = gc_cons_threshold + 1;
recompute_need_to_garbage_collect ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
release_breathing_space ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Flush some histories which might conceivably contain garbalogical
inhibitors. */
@@ -302,7 +302,7 @@ do \
} \
while (0)
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define FREE_OR_REALLOC_BEGIN(block) \
do \
{ \
@@ -313,7 +313,7 @@ do \
MALLOC_BEGIN (); \
} \
while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define FREE_OR_REALLOC_BEGIN(block) \
do \
{ \
@@ -329,7 +329,7 @@ do \
MALLOC_BEGIN (); \
} \
while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define MALLOC_END() \
do \
@@ -415,7 +415,7 @@ xfree_1 (void *block)
#ifdef ERROR_CHECK_GC
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
deadbeef_memory (void *ptr, Bytecount size)
{
@@ -426,7 +426,7 @@ deadbeef_memory (void *ptr, Bytecount si
while (beefs--)
(*ptr4++) = 0xDEADBEEF; /* -559038737 base 10 */
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#else /* !ERROR_CHECK_GC */
@@ -455,7 +455,7 @@ strdup (const char *s)
#endif /* NEED_STRDUP */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void *
allocate_lisp_storage (Bytecount size)
{
@@ -480,9 +480,9 @@ allocate_lisp_storage (Bytecount size)
return val;
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#if defined (MC_ALLOC) && defined (ALLOC_TYPE_STATS)
+#if defined (NEW_GC) && defined (ALLOC_TYPE_STATS)
static struct
{
int instances_in_use;
@@ -539,16 +539,16 @@ lrecord_stats_heap_size (void)
size += lrecord_stats[i].bytes_in_use;
return size;
}
-#endif /* not (MC_ALLOC && ALLOC_TYPE_STATS) */
+#endif /* NEW_GC && ALLOC_TYPE_STATS */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* lcrecords are chained together through their "next" field.
After doing the mark phase, GC will walk this linked list
and free any lcrecord which hasn't been marked. */
static struct old_lcrecord_header *all_lcrecords;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* The basic lrecord allocation functions. See lrecord.h for details. */
void *
alloc_lrecord (Bytecount size,
@@ -567,6 +567,8 @@ alloc_lrecord (Bytecount size,
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
#endif /* ALLOC_TYPE_STATS */
+ if (implementation->finalizer)
+ add_finalizable_obj (wrap_pointer_1 (lheader));
INCREMENT_CONS_COUNTER (size, implementation->name);
return lheader;
}
@@ -589,11 +591,12 @@ noseeum_alloc_lrecord (Bytecount size,
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
#endif /* ALLOC_TYPE_STATS */
+ if (implementation->finalizer)
+ add_finalizable_obj (wrap_pointer_1 (lheader));
NOSEEUM_INCREMENT_CONS_COUNTER (size, implementation->name);
return lheader;
}
-#ifdef NEW_GC
void *
alloc_lrecord_array (Bytecount size, int elemcount,
const struct lrecord_implementation *implementation)
@@ -619,35 +622,20 @@ alloc_lrecord_array (Bytecount size, int
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lh);
#endif /* not ALLOC_TYPE_STATS */
+ if (implementation->finalizer)
+ add_finalizable_obj (wrap_pointer_1 (lh));
}
INCREMENT_CONS_COUNTER (size * elemcount, implementation->name);
return lheader;
}
-#endif /* NEW_GC */
void
-free_lrecord (Lisp_Object lrecord)
+free_lrecord (Lisp_Object UNUSED (lrecord))
{
-#ifndef NEW_GC
- gc_checking_assert (!gc_in_progress);
-#endif /* not NEW_GC */
- gc_checking_assert (!LRECORD_FREE_P (XRECORD_LHEADER (lrecord)));
- gc_checking_assert (!XRECORD_LHEADER (lrecord)->free);
-
-#ifdef NEW_GC
- GC_STAT_EXPLICITLY_TRIED_FREED;
- /* Ignore requests to manual free objects while in garbage collection. */
- if (write_barrier_enabled || gc_in_progress)
- return;
-
- GC_STAT_EXPLICITLY_FREED;
-#endif /* NEW_GC */
-
- MC_ALLOC_CALL_FINALIZER (XPNTR (lrecord));
- mc_free (XPNTR (lrecord));
- recompute_need_to_garbage_collect ();
+ /* Manual frees are not allowed with asynchronous finalization */
+ return;
}
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* The most basic of the lcrecord allocation functions. Not usually called
directly. Allocates an lrecord not managed by any lcrecord-list, of a
@@ -719,15 +707,15 @@ very_old_free_lcrecord (struct old_lcrec
return;
}
#endif /* Unused */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static void
disksave_object_finalization_1 (void)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
mc_finalize_for_disksave ();
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
struct old_lcrecord_header *header;
for (header = all_lcrecords; header; header = header->next)
@@ -736,7 +724,7 @@ disksave_object_finalization_1 (void)
!header->free)
LHEADER_IMPLEMENTATION (&header->lheader)->finalizer (header, 1);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
/* Bitwise copy all parts of a Lisp object other than the header */
@@ -751,11 +739,11 @@ copy_lisp_object (Lisp_Object dst, Lisp_
assert (imp == XRECORD_LHEADER_IMPLEMENTATION (dst));
assert (size == lisp_object_size (dst));
-#ifdef MC_ALLOC
+#ifdef NEW_GC
memcpy ((char *) XRECORD_LHEADER (dst) + sizeof (struct lrecord_header),
(char *) XRECORD_LHEADER (src) + sizeof (struct lrecord_header),
size - sizeof (struct lrecord_header));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
if (imp->basic_p)
memcpy ((char *) XRECORD_LHEADER (dst) + sizeof (struct lrecord_header),
(char *) XRECORD_LHEADER (src) + sizeof (struct lrecord_header),
@@ -766,7 +754,7 @@ copy_lisp_object (Lisp_Object dst, Lisp_
(char *) XRECORD_LHEADER (src) +
sizeof (struct old_lcrecord_header),
size - sizeof (struct old_lcrecord_header));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
@@ -814,7 +802,7 @@ dbg_eq (Lisp_Object obj1, Lisp_Object ob
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DECLARE_FIXED_TYPE_ALLOC(type, structture) struct __foo__
#else
/************************************************************************/
@@ -1164,9 +1152,9 @@ do { FREE_FIXED_TYPE (type, structtype,
#else
#define FREE_FIXED_TYPE_WHEN_NOT_IN_GC(type, structtype, ptr)
#endif
-#endif /* not MC_ALLOC */
+#endif /* NEW_GC */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr) \
do { \
(var) = alloc_lrecord_type (lisp_type, lrec_ptr); \
@@ -1176,7 +1164,7 @@ do { \
do { \
(var) = noseeum_alloc_lrecord_type (lisp_type, lrec_ptr); \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr) \
do \
{ \
@@ -1190,7 +1178,7 @@ do \
NOSEEUM_ALLOCATE_FIXED_TYPE (type, lisp_type, var); \
set_lheader_implementation (&(var)->lheader, lrec_ptr); \
} while (0)
-#endif /* MC_ALLOC */
+#endif /* not NEW_GC */
@@ -2292,7 +2280,7 @@ string_plist (Lisp_Object string)
return *string_plist_ptr (string);
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* No `finalize', or `hash' methods.
internal_hash() already knows how to hash strings and finalization
is done with the ADDITIONAL_FREE_string macro, which is the
@@ -2309,7 +2297,7 @@ DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH
string_remprop,
string_plist,
Lisp_String);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef NEW_GC
#define STRING_FULLSIZE(size) \
@@ -2348,32 +2336,7 @@ static struct string_chars_block *curren
#define MARK_STRING_CHARS_AS_FREE(ptr) ((void) ((ptr)->string = NULL))
#endif /* not NEW_GC */
-#ifdef MC_ALLOC
-#ifndef NEW_GC
-static void
-finalize_string (void *header, int for_disksave)
-{
- if (!for_disksave)
- {
- Lisp_String *s = (Lisp_String *) header;
- Bytecount size = s->size_;
- if (BIG_STRING_SIZE_P (size))
- xfree (s->data_, Ibyte *);
- }
-}
-
-DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("string", string,
- 1, /*dumpable-flag*/
- mark_string, print_string,
- finalize_string,
- string_equal, 0,
- string_description,
- string_getprop,
- string_putprop,
- string_remprop,
- string_plist,
- Lisp_String);
-#else /* NEW_GC */
+#ifdef NEW_GC
DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("string", string,
1, /*dumpable-flag*/
mark_string, print_string,
@@ -2422,7 +2385,6 @@ DEFINE_LRECORD_IMPLEMENTATION ("string-i
string_indirect_data_description,
Lisp_String_Indirect_Data);
#endif /* NEW_GC */
-#endif /* MC_ALLOC */
#ifndef NEW_GC
struct string_chars
@@ -2524,14 +2486,14 @@ make_uninit_string (Bytecount length)
assert (length >= 0 && fullsize > 0);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
s = alloc_lrecord_type (Lisp_String, &lrecord_string);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* Allocate the string header */
ALLOCATE_FIXED_TYPE (string, Lisp_String, s);
xzero (*s);
set_lheader_implementation (&s->u.lheader, &lrecord_string);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* The above allocations set the UID field, which overlaps with the
ascii-length field, to some non-zero value. We need to zero it. */
@@ -2616,7 +2578,7 @@ resize_string (Lisp_Object s, Bytecount
memmove (XSTRING_DATA (s) + pos + delta, XSTRING_DATA (s) + pos,
len);
-#else /* NEW_GC */
+#else /* not NEW_GC */
oldfullsize = STRING_FULLSIZE (XSTRING_LENGTH (s));
newfullsize = STRING_FULLSIZE (XSTRING_LENGTH (s) + delta);
@@ -2929,17 +2891,17 @@ make_string_nocopy (const Ibyte *content
bytecount_to_charcount (contents, length); /* Just for the assertions */
#endif
-#ifdef MC_ALLOC
+#ifdef NEW_GC
s = alloc_lrecord_type (Lisp_String, &lrecord_string);
mcpro (wrap_pointer_1 (s)); /* otherwise nocopy_strings get
collected and static data is tried to
be freed. */
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* Allocate the string header */
ALLOCATE_FIXED_TYPE (string, Lisp_String, s);
set_lheader_implementation (&s->u.lheader, &lrecord_string);
SET_C_READONLY_RECORD_HEADER (&s->u.lheader);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Don't need to XSET_STRING_ASCII_BEGIN() here because it happens in
init_string_ascii_begin(). */
s->plist = Qnil;
@@ -2963,7 +2925,7 @@ make_string_nocopy (const Ibyte *content
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/************************************************************************/
/* lcrecord lists */
/************************************************************************/
@@ -3171,7 +3133,7 @@ old_free_lcrecord (Lisp_Object rec)
free_managed_lcrecord (all_lcrecord_lists[type], rec);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
DEFUN ("purecopy", Fpurecopy, 1, 1, 0, /*
@@ -3350,7 +3312,7 @@ unstaticpro_nodump (Lisp_Object *varaddr
-#ifdef MC_ALLOC
+#ifdef NEW_GC
static const struct memory_description mcpro_description_1[] = {
{ XD_END }
};
@@ -3421,10 +3383,10 @@ mcpro (Lisp_Object varaddress)
}
#endif /* not DEBUG_XEMACS */
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static int gc_count_num_short_string_in_use;
static Bytecount gc_count_string_total_size;
static Bytecount gc_count_short_string_total_size;
@@ -3470,10 +3432,10 @@ tick_lcrecord_stats (const struct lrecor
}
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* Free all unmarked records */
static void
sweep_lcrecords_1 (struct old_lcrecord_header **prev, int *used)
@@ -3669,10 +3631,10 @@ do { \
#define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type) \
SWEEP_FIXED_TYPE_BLOCK_1 (typename, obj_type, lheader)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_conses (void)
{
@@ -3681,20 +3643,20 @@ sweep_conses (void)
SWEEP_FIXED_TYPE_BLOCK (cons, Lisp_Cons);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Explicitly free a cons cell. */
void
free_cons (Lisp_Object cons)
{
-#ifndef MC_ALLOC /* to avoid compiler warning */
+#ifndef NEW_GC /* to avoid compiler warning */
Lisp_Cons *ptr = XCONS (cons);
-#endif /* MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef ERROR_CHECK_GC
-#ifdef MC_ALLOC
+#ifdef NEW_GC
Lisp_Cons *ptr = XCONS (cons);
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
/* If the CAR is not an int, then it will be a pointer, which will
always be four-byte aligned. If this cons cell has already been
placed on the free list, however, its car will probably contain
@@ -3709,11 +3671,11 @@ free_cons (Lisp_Object cons)
ASSERT_VALID_POINTER (XPNTR (cons_car (ptr)));
#endif /* ERROR_CHECK_GC */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (cons);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (cons, Lisp_Cons, ptr);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
/* explicitly free a list. You **must make sure** that you have
@@ -3751,7 +3713,7 @@ free_alist (Lisp_Object alist)
}
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_compiled_functions (void)
{
@@ -3830,11 +3792,11 @@ sweep_events (void)
SWEEP_FIXED_TYPE_BLOCK (event, Lisp_Event);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef EVENT_DATA_AS_OBJECTS
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_key_data (void)
{
@@ -3843,19 +3805,19 @@ sweep_key_data (void)
SWEEP_FIXED_TYPE_BLOCK (key_data, Lisp_Key_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_key_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (key_data, Lisp_Key_Data, XKEY_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_button_data (void)
{
@@ -3864,19 +3826,19 @@ sweep_button_data (void)
SWEEP_FIXED_TYPE_BLOCK (button_data, Lisp_Button_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_button_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (button_data, Lisp_Button_Data, XBUTTON_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_motion_data (void)
{
@@ -3885,19 +3847,19 @@ sweep_motion_data (void)
SWEEP_FIXED_TYPE_BLOCK (motion_data, Lisp_Motion_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_motion_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (motion_data, Lisp_Motion_Data, XMOTION_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_process_data (void)
{
@@ -3906,19 +3868,19 @@ sweep_process_data (void)
SWEEP_FIXED_TYPE_BLOCK (process_data, Lisp_Process_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_process_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (process_data, Lisp_Process_Data, XPROCESS_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_timeout_data (void)
{
@@ -3927,19 +3889,19 @@ sweep_timeout_data (void)
SWEEP_FIXED_TYPE_BLOCK (timeout_data, Lisp_Timeout_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_timeout_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (timeout_data, Lisp_Timeout_Data, XTIMEOUT_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_magic_data (void)
{
@@ -3948,19 +3910,19 @@ sweep_magic_data (void)
SWEEP_FIXED_TYPE_BLOCK (magic_data, Lisp_Magic_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_magic_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (magic_data, Lisp_Magic_Data, XMAGIC_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_magic_eval_data (void)
{
@@ -3969,19 +3931,19 @@ sweep_magic_eval_data (void)
SWEEP_FIXED_TYPE_BLOCK (magic_eval_data, Lisp_Magic_Eval_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_magic_eval_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (magic_eval_data, Lisp_Magic_Eval_Data, XMAGIC_EVAL_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_eval_data (void)
{
@@ -3990,19 +3952,19 @@ sweep_eval_data (void)
SWEEP_FIXED_TYPE_BLOCK (eval_data, Lisp_Eval_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_eval_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (eval_data, Lisp_Eval_Data, XEVAL_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_misc_user_data (void)
{
@@ -4011,21 +3973,21 @@ sweep_misc_user_data (void)
SWEEP_FIXED_TYPE_BLOCK (misc_user_data, Lisp_Misc_User_Data);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
free_misc_user_data (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (misc_user_data, Lisp_Misc_User_Data, XMISC_USER_DATA (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
#endif /* EVENT_DATA_AS_OBJECTS */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_markers (void)
{
@@ -4038,17 +4000,17 @@ sweep_markers (void)
SWEEP_FIXED_TYPE_BLOCK (marker, Lisp_Marker);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Explicitly free a marker. */
void
free_marker (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
FREE_FIXED_TYPE_WHEN_NOT_IN_GC (marker, Lisp_Marker, XMARKER (ptr));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
@@ -4201,7 +4163,7 @@ compact_string_chars (void)
}
#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
#if 1 /* Hack to debug missing purecopy's */
static int debug_string_purity;
@@ -4224,9 +4186,9 @@ debug_string_purity_print (Lisp_Object p
stderr_out ("\"\n");
}
#endif /* 1 */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
sweep_strings (void)
{
@@ -4259,17 +4221,12 @@ sweep_strings (void)
gc_count_string_total_size = num_bytes;
gc_count_short_string_total_size = num_small_bytes;
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifndef NEW_GC
void
gc_sweep_1 (void)
{
-#ifdef MC_ALLOC
- compact_string_chars ();
- mc_finalize ();
- mc_sweep ();
-#else /* not MC_ALLOC */
/* Free all unmarked records. Do this at the very beginning,
before anything else, so that the finalize methods can safely
examine items in the objects. sweep_lcrecords_1() makes
@@ -4344,13 +4301,12 @@ gc_sweep_1 (void)
sweep_eval_data ();
sweep_misc_user_data ();
#endif /* EVENT_DATA_AS_OBJECTS */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
#ifdef PDUMP
pdump_objects_unmark ();
#endif
-#endif /* not MC_ALLOC */
}
#endif /* not NEW_GC */
@@ -4440,7 +4396,7 @@ object_memory_usage_stats (int set_total
int i;
EMACS_INT tgu_val = 0;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
for (i = 0; i < (countof (lrecord_implementations_table)
+ MODULE_DEFINABLE_TYPE_COUNT); i++)
@@ -4475,7 +4431,7 @@ object_memory_usage_stats (int set_total
}
}
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define HACK_O_MATIC(type, name, pl) do { \
EMACS_INT s = 0; \
@@ -4577,7 +4533,7 @@ object_memory_usage_stats (int set_total
#undef HACK_O_MATIC
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
if (set_total_gc_usage)
{
@@ -4625,7 +4581,7 @@ Garbage collection happens automatically
total_gc_usage_set = 0;
#ifdef ALLOC_TYPE_STATS
/* The things we do for backwards-compatibility */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
return
list6
(Fcons (make_int (lrecord_stats[lrecord_type_cons].instances_in_use),
@@ -4642,7 +4598,7 @@ Garbage collection happens automatically
make_int (lrecord_stats[lrecord_type_vector]
.bytes_in_use_including_overhead),
object_memory_usage_stats (1));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
return
list6 (Fcons (make_int (gc_count_num_cons_in_use),
make_int (gc_count_num_cons_freelist)),
@@ -4654,7 +4610,7 @@ Garbage collection happens automatically
make_int (lcrecord_stats[lrecord_type_vector].bytes_in_use +
lcrecord_stats[lrecord_type_vector].bytes_freed),
object_memory_usage_stats (1));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#else /* not ALLOC_TYPE_STATS */
return Qnil;
#endif /* ALLOC_TYPE_STATS */
@@ -4849,7 +4805,7 @@ malloced_storage_size (void *UNUSED (ptr
return claimed_size;
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
Bytecount
fixed_type_block_overhead (Bytecount size)
{
@@ -4865,7 +4821,7 @@ fixed_type_block_overhead (Bytecount siz
overhead += sizeof (void *) + per_block - storage_size;
return overhead;
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#endif /* MEMORY_USAGE_STATS */
@@ -4883,12 +4839,10 @@ common_init_alloc_early (void)
Qnull_pointer = wrap_pointer_1 (0);
#endif
-#ifndef MC_ALLOC
+#ifndef NEW_GC
breathing_space = 0;
-#endif /* not MC_ALLOC */
-#ifndef MC_ALLOC
all_lcrecords = 0;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
ignore_malloc_warnings = 1;
#ifdef DOUG_LEA_MALLOC
mallopt (M_TRIM_THRESHOLD, 128*1024); /* trim threshold */
@@ -4899,8 +4853,6 @@ common_init_alloc_early (void)
#endif
#ifndef NEW_GC
init_string_chars_alloc ();
-#endif /* not NEW_GC */
-#ifndef MC_ALLOC
init_string_alloc ();
init_string_chars_alloc ();
init_cons_alloc ();
@@ -4930,7 +4882,7 @@ common_init_alloc_early (void)
init_eval_data_alloc ();
init_misc_user_data_alloc ();
#endif /* EVENT_DATA_AS_OBJECTS */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
ignore_malloc_warnings = 0;
@@ -4945,7 +4897,7 @@ common_init_alloc_early (void)
Dynarr_resize (staticpro_nodump_names, 100); /* ditto */
#endif
-#ifdef MC_ALLOC
+#ifdef NEW_GC
mcpros = Dynarr_new2 (Lisp_Object_dynarr, Lisp_Object);
Dynarr_resize (mcpros, 1410); /* merely a small optimization */
dump_add_root_block_ptr (&mcpros, &mcpros_description);
@@ -4954,7 +4906,7 @@ common_init_alloc_early (void)
Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */
dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description);
#endif
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
consing_since_gc = 0;
need_to_check_c_alloca = 0;
@@ -4962,9 +4914,9 @@ common_init_alloc_early (void)
funcall_alloca_count = 0;
lrecord_uid_counter = 259;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
debug_string_purity = 0;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef ERROR_CHECK_TYPES
ERROR_ME.really_unlikely_name_to_have_accidentally_in_a_non_errb_structure =
@@ -4980,7 +4932,7 @@ common_init_alloc_early (void)
#endif /* ERROR_CHECK_TYPES */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static void
init_lcrecord_lists (void)
{
@@ -4992,7 +4944,7 @@ init_lcrecord_lists (void)
staticpro_nodump (&all_lcrecord_lists[i]);
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
init_alloc_early (void)
@@ -5013,9 +4965,9 @@ void
reinit_alloc_early (void)
{
common_init_alloc_early ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
init_lcrecord_lists ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
void
@@ -5036,10 +4988,10 @@ init_alloc_once_early (void)
INIT_LRECORD_IMPLEMENTATION (string_indirect_data);
INIT_LRECORD_IMPLEMENTATION (string_direct_data);
#endif /* NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
INIT_LRECORD_IMPLEMENTATION (lcrecord_list);
INIT_LRECORD_IMPLEMENTATION (free);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
staticpros = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *);
Dynarr_resize (staticpros, 1410); /* merely a small optimization */
@@ -5050,7 +5002,7 @@ init_alloc_once_early (void)
dump_add_root_block_ptr (&staticpro_names, &staticpro_names_description);
#endif
-#ifdef MC_ALLOC
+#ifdef NEW_GC
mcpros = Dynarr_new2 (Lisp_Object_dynarr, Lisp_Object);
Dynarr_resize (mcpros, 1410); /* merely a small optimization */
dump_add_root_block_ptr (&mcpros, &mcpros_description);
@@ -5059,11 +5011,9 @@ init_alloc_once_early (void)
Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */
dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description);
#endif
-#endif /* MC_ALLOC */
-
-#ifndef MC_ALLOC
+#else /* not NEW_GC */
init_lcrecord_lists ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
void
1.76 +3 -3 XEmacs/xemacs/src/buffer.c
Index: buffer.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -p -r1.75 -r1.76
--- buffer.c 2005/12/17 21:04:16 1.75
+++ buffer.c 2006/02/27 16:29:22 1.76
@@ -2130,7 +2130,7 @@ List of functions called with no args to
/* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magic_fun) \
do \
{ \
@@ -2155,7 +2155,7 @@ do \
} \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes
a bogus extra arg, which confuses an otherwise identical make-docfile.c */
#define DEFVAR_BUFFER_LOCAL_1(lname, field_name, forward_type, magicfun) \
@@ -2189,7 +2189,7 @@ do { \
= intern (lname); \
} \
} while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define DEFVAR_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) \
DEFVAR_BUFFER_LOCAL_1 (lname, field_name, \
1.49 +0 -24 XEmacs/xemacs/src/bytecode.c
Index: bytecode.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/bytecode.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -p -r1.48 -r1.49
--- bytecode.c 2005/11/25 01:41:56 1.48
+++ bytecode.c 2006/02/27 16:29:22 1.49
@@ -2247,38 +2247,14 @@ static const struct memory_description c
{ XD_END }
};
-#if defined(MC_ALLOC) && !defined(NEW_GC)
-static void
-finalize_compiled_function (void *header, int for_disksave)
-{
- if (!for_disksave)
- {
- struct Lisp_Compiled_Function *cf =
- (struct Lisp_Compiled_Function *) header;
- if (cf->args_in_array)
- xfree (cf->args, Lisp_Object *);
- }
-}
-
DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function,
1, /*dumpable_flag*/
mark_compiled_function,
- print_compiled_function,
- finalize_compiled_function,
- compiled_function_equal,
- compiled_function_hash,
- compiled_function_description,
- Lisp_Compiled_Function);
-#else /* !MC_ALLOC || NEW_GC */
-DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function,
- 1, /*dumpable_flag*/
- mark_compiled_function,
print_compiled_function, 0,
compiled_function_equal,
compiled_function_hash,
compiled_function_description,
Lisp_Compiled_Function);
-#endif /* !MC_ALLOC || NEW_GC */
DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /*
1.10 +1 -1 XEmacs/xemacs/src/bytecode.h
Index: bytecode.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/bytecode.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- bytecode.h 2005/11/25 01:41:56 1.9
+++ bytecode.h 2006/02/27 16:29:22 1.10
@@ -55,7 +55,7 @@ DECLARE_LRECORD (compiled_function_args,
#define compiled_function_args_data(v) ((v)->args)
#define XCOMPILED_FUNCTION_ARGS_DATA(s) \
compiled_function_args_data (XCOMPILED_FUNCTION_ARGS (s))
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
/* Meanings of slots in a Lisp_Compiled_Function.
Don't use these! For backward compatibility only. */
1.106 +2 -4 XEmacs/xemacs/src/config.h.in
Index: config.h.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -p -r1.105 -r1.106
--- config.h.in 2005/12/27 18:51:29 1.105
+++ config.h.in 2006/02/27 16:29:22 1.106
@@ -693,10 +693,8 @@ things are arranged in config.h.in. In
/* If defined, use experimental pdump-based GC algorithms. */
#undef USE_KKCC
-/* If defined, use experimental allocator. */
-#undef MC_ALLOC
-
-/* If defined, use experimental incremental garbage collector. */
+/* If defined, use experimental incremental garbage collector and new
+ allocator. */
#undef NEW_GC
/* Virtual dirty bit implementation for incremental gc. */
1.27 +1 -3 XEmacs/xemacs/src/console-stream.c
Index: console-stream.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-stream.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- console-stream.c 2005/11/25 01:41:57 1.26
+++ console-stream.c 2006/02/27 16:29:23 1.27
@@ -137,9 +137,7 @@ stream_delete_console (struct console *c
if (stream_con->in != stdin)
retry_fclose (stream_con->in);
-#ifdef NEW_GC
- mc_free (stream_con);
-#else /* not NEW_GC */
+#ifndef NEW_GC
xfree (stream_con, struct stream_console *);
#endif /* not NEW_GC */
CONSOLE_STREAM_DATA (con) = NULL;
1.47 +4 -4 XEmacs/xemacs/src/console.c
Index: console.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- console.c 2005/12/18 11:44:28 1.46
+++ console.c 2006/02/27 16:29:23 1.47
@@ -1202,7 +1202,7 @@ syms_of_console (void)
INIT_LRECORD_IMPLEMENTATION (tty_console);
#endif
INIT_LRECORD_IMPLEMENTATION (stream_console);
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
DEFSUBR (Fvalid_console_type_p);
DEFSUBR (Fconsole_type_list);
@@ -1325,7 +1325,7 @@ One argument, the to-be-deleted console.
}
/* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \
do { \
struct symbol_value_forward *I_hate_C = \
@@ -1349,7 +1349,7 @@ do { \
= intern (lname); \
} \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) \
do { \
static const struct symbol_value_forward I_hate_C = \
@@ -1382,7 +1382,7 @@ do { \
= intern (lname); \
} \
} while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \
DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \
1.34 +50 -52 XEmacs/xemacs/src/dumper.c
Index: dumper.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -p -r1.33 -r1.34
--- dumper.c 2005/11/28 15:44:06 1.33
+++ dumper.c 2006/02/27 16:29:23 1.34
@@ -237,7 +237,7 @@ typedef struct
static Rawbyte *pdump_rt_list = 0;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void
pdump_objects_unmark (void)
{
@@ -261,10 +261,10 @@ pdump_objects_unmark (void)
break;
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* The structure of the dump file looks like this:
0 - header
- dumped objects
@@ -281,7 +281,7 @@ pdump_objects_unmark (void)
- root lisp object address/value couples with the count
preceding the list
*/
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* The structure of the dump file looks like this:
0 - header
- dumped objects
@@ -296,7 +296,7 @@ pdump_objects_unmark (void)
- root lisp object address/value couples with the count
preceding the list
*/
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define PDUMP_SIGNATURE "XEmacsDP"
@@ -434,7 +434,7 @@ static int pdump_fd;
static void *pdump_buf;
static FILE *pdump_out;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* PDUMP_HASHSIZE is a large prime. */
#define PDUMP_HASHSIZE 1000003
/* Nothing special about PDUMP_HASH_MULTIPLIER: arbitrary odd integer
@@ -443,23 +443,23 @@ static FILE *pdump_out;
/* Nothing special about PDUMP_HASH_STEP: arbitrary integer for linear
probing. */
#define PDUMP_HASH_STEP 574853
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define PDUMP_HASHSIZE 200001
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static pdump_block_list_elt **pdump_hash;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static int
pdump_make_hash (const void *obj)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
return ((unsigned long)(obj) * PDUMP_HASH_MULTIPLIER) % PDUMP_HASHSIZE;
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
/* Return the entry for an already-registered memory block at OBJ,
@@ -524,7 +524,7 @@ pdump_add_block (pdump_block_list *list,
}
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
typedef struct mc_addr_elt
{
const void *obj;
@@ -587,7 +587,7 @@ pdump_put_mc_addr (const void *obj, EMAC
pdump_mc_hash[pos].obj = obj;
pdump_mc_hash[pos].addr = addr;
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
static pdump_block_list *
pdump_get_block_list (const struct memory_description *desc)
@@ -879,6 +879,11 @@ pdump_register_object (Lisp_Object obj)
imp = LHEADER_IMPLEMENTATION (objh);
if (imp->description
+#ifdef NEW_GC
+ /* Objects with finalizers cannot be dumped with the new
+ allocator's asynchronous finalization strategy. */
+ && !imp->finalizer
+#endif /* not NEW_GC */
&& RECORD_DUMPABLE (objh))
{
pdump_bump_depth ();
@@ -1200,7 +1205,7 @@ pdump_dump_data (pdump_block_list_elt *e
retry_fwrite (desc ? pdump_buf : elt->obj, size, count, pdump_out);
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* To be able to relocate during load time, more information about the
dumped objects are needed: The count (for array-like data
structures), the size of the object, and the location in the dumped
@@ -1237,9 +1242,6 @@ pdump_scan_lisp_objects_by_alignment (vo
if (pdump_object_table[i].align == align)
for (elt = pdump_object_table[i].first; elt; elt = elt->next)
{
-#ifndef NEW_GC
- assert (elt->count == 1);
-#endif /* not NEW_GC */
f (elt, lrecord_implementations_table[i]->description);
}
}
@@ -1300,9 +1302,7 @@ pdump_reloc_one_mc (void *data, const st
case XD_LONG:
case XD_INT_RESET:
break;
-#ifdef NEW_GC
case XD_LISP_OBJECT_BLOCK_PTR:
-#endif /* NEW_GC */
case XD_OPAQUE_DATA_PTR:
case XD_ASCII_STRING:
case XD_BLOCK_PTR:
@@ -1405,7 +1405,7 @@ pdump_reloc_one_mc (void *data, const st
}
}
}
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* Relocate a single memory block at DATA, described by DESC, from its
assumed load location to its actual one by adding DELTA to all pointers
in the block. Does not recursively relocate any other memory blocks
@@ -1539,7 +1539,7 @@ pdump_reloc_one (void *data, EMACS_INT d
}
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static void
pdump_allocate_offset (pdump_block_list_elt *elt,
@@ -2160,7 +2160,7 @@ pdump (void)
fseek (pdump_out, header.stab_offset, SEEK_SET);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
{
EMACS_INT zero = 0;
pdump_scan_lisp_objects_by_alignment (pdump_dump_mc_data);
@@ -2168,17 +2168,17 @@ pdump (void)
pdump_scan_non_lisp_objects_by_alignment (pdump_dump_mc_data);
PDUMP_WRITE_ALIGNED (EMACS_INT, zero);
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
pdump_dump_cv_data_info ();
pdump_dump_cv_ptr_info ();
-#ifdef MC_ALLOC
+#ifdef NEW_GC
pdump_dump_rtables ();
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
pdump_dump_root_block_ptrs ();
pdump_dump_root_blocks ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
pdump_dump_rtables ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
pdump_dump_root_lisp_objects ();
retry_fclose (pdump_out);
@@ -2227,7 +2227,7 @@ pdump_load_finish (void)
delta = ((EMACS_INT) pdump_start) - header->reloc_address;
p = pdump_start + header->stab_offset;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
pdump_mc_hash = xnew_array_and_zero (mc_addr_elt, PDUMP_HASHSIZE);
/* Allocate space for each object individually. First the
@@ -2251,10 +2251,8 @@ pdump_load_finish (void)
{
if (elt_count <= 1)
mc_addr = (Rawbyte *) mc_alloc (real_size);
-#ifdef NEW_GC
else
mc_addr = (Rawbyte *) mc_alloc_array (size, elt_count);
-#endif /* NEW_GC */
#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (real_size,
(const struct lrecord_header *)
@@ -2274,7 +2272,7 @@ pdump_load_finish (void)
else if (!(--count))
break;
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
/* Get the cv_data array */
p = (Rawbyte *) ALIGN_PTR (p, pdump_cv_data_dump_info);
@@ -2293,7 +2291,7 @@ pdump_load_finish (void)
pdump_loaded_cv_ptr[i].adr = 0;
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* Relocate the heap objects */
pdump_rt_list = p;
count = 2;
@@ -2314,18 +2312,18 @@ pdump_load_finish (void)
else if (!(--count))
break;
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
/* Put back the pdump_root_block_ptrs */
p = (Rawbyte *) ALIGN_PTR (p, pdump_static_pointer);
for (i = 0; i < header->nb_root_block_ptrs; i++)
{
pdump_static_pointer ptr = PDUMP_READ (p, pdump_static_pointer);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
(* ptr.address) = (Rawbyte *) pdump_get_mc_addr (ptr.value);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
(* ptr.address) = ptr.value + delta;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
/* Put back the pdump_root_blocks and relocate */
@@ -2334,15 +2332,15 @@ pdump_load_finish (void)
pdump_root_block info = PDUMP_READ_ALIGNED (p, pdump_root_block);
memcpy ((void *) info.blockaddr, p, info.size);
if (info.desc)
-#ifdef MC_ALLOC
+#ifdef NEW_GC
pdump_reloc_one_mc ((void *) info.blockaddr, info.desc);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
pdump_reloc_one ((void *) info.blockaddr, delta, info.desc);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
p += info.size;
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* Relocate the heap objects */
pdump_rt_list = p;
count = 2;
@@ -2363,7 +2361,7 @@ pdump_load_finish (void)
else if (!(--count))
break;
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Put the pdump_root_lisp_objects variables in place */
i = PDUMP_READ_ALIGNED (p, Elemcount);
@@ -2373,12 +2371,12 @@ pdump_load_finish (void)
pdump_static_Lisp_Object obj = PDUMP_READ (p, pdump_static_Lisp_Object);
if (POINTER_TYPE_P (XTYPE (obj.value)))
-#ifdef MC_ALLOC
+#ifdef NEW_GC
obj.value = wrap_pointer_1 ((Rawbyte *) pdump_get_mc_addr
(XPNTR (obj.value)));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
obj.value = wrap_pointer_1 ((Rawbyte *) XPNTR (obj.value) + delta);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
(* obj.address) = obj.value;
}
@@ -2402,9 +2400,9 @@ pdump_load_finish (void)
p += sizeof (Lisp_Object) * rt.count;
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
xfree (pdump_mc_hash, mc_addr_elt *);
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
#ifdef NEW_GC
allow_incremental_gc = allow_inc_gc;
@@ -2748,9 +2746,9 @@ pdump_load (const Wexttext *argv0)
{
pdump_load_finish ();
in_pdump = 0;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
pdump_free ();
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
return 1;
}
@@ -2761,9 +2759,9 @@ pdump_load (const Wexttext *argv0)
{
pdump_load_finish ();
in_pdump = 0;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
pdump_free ();
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
return 1;
}
pdump_free ();
1.9 +2 -2 XEmacs/xemacs/src/dumper.h
Index: dumper.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- dumper.h 2005/04/08 23:11:23 1.8
+++ dumper.h 2006/02/27 16:29:23 1.9
@@ -27,9 +27,9 @@ Boston, MA 02111-1307, USA. */
BEGIN_C_DECLS
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void pdump_objects_unmark (void);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void pdump (void);
int pdump_load (const Wexttext *argv0);
void pdump_backtrace (void);
1.45 +13 -2 XEmacs/xemacs/src/elhash.c
Index: elhash.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/elhash.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- elhash.c 2005/11/25 01:42:00 1.44
+++ elhash.c 2006/02/27 16:29:23 1.45
@@ -417,9 +417,9 @@ free_hentries (
#endif
#ifdef ERROR_CHECK_STRUCTURES
size_t size
-#else
+#else /* not (NEW_GC && ! ERROR_CHECK_STRUCTURES) */
size_t UNUSED (size)
-#endif
+#endif /* not (NEW_GC && ! ERROR_CHECK_STRUCTURES) */
)
{
#ifdef NEW_GC
@@ -443,6 +443,7 @@ free_hentries (
#endif /* not NEW_GC */
}
+#ifndef NEW_GC
static void
finalize_hash_table (void *header, int for_disksave)
{
@@ -453,6 +454,7 @@ finalize_hash_table (void *header, int f
ht->hentries = 0;
}
}
+#endif /* not NEW_GC */
static const struct memory_description htentry_description_1[] = {
{ XD_LISP_OBJECT, offsetof (htentry, key) },
@@ -515,6 +517,14 @@ const struct memory_description hash_tab
{ XD_END }
};
+#ifdef NEW_GC
+DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table,
+ 1, /*dumpable-flag*/
+ mark_hash_table, print_hash_table,
+ 0, hash_table_equal, hash_table_hash,
+ hash_table_description,
+ Lisp_Hash_Table);
+#else /* not NEW_GC */
DEFINE_LRECORD_IMPLEMENTATION ("hash-table", hash_table,
1, /*dumpable-flag*/
mark_hash_table, print_hash_table,
@@ -522,6 +532,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("hash-tab
hash_table_equal, hash_table_hash,
hash_table_description,
Lisp_Hash_Table);
+#endif /* not NEW_GC */
static Lisp_Hash_Table *
xhash_table (Lisp_Object hash_table)
1.164 +11 -11 XEmacs/xemacs/src/emacs.c
Index: emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -p -r1.163 -r1.164
--- emacs.c 2005/12/27 18:51:29 1.163
+++ emacs.c 2006/02/27 16:29:23 1.164
@@ -914,7 +914,7 @@ main_1 (int argc, Wexttext **argv, Wextt
display_use = 0;
inhibit_non_essential_conversion_operations = 1;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#ifndef PDUMP
if (!initialized)
#endif
@@ -927,7 +927,7 @@ main_1 (int argc, Wexttext **argv, Wextt
#endif /* ALLOC_TYPE_STATS */
}
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
#ifdef NeXT
/* 19-Jun-1995 -baw
@@ -1320,7 +1320,7 @@ main_1 (int argc, Wexttext **argv, Wextt
init_signals_very_early ();
#ifdef NEW_GC
vdb_install_signal_handler ();
-#endif
+#endif /* NEW_GC */
init_data_very_early (); /* Catch math errors. */
init_floatfns_very_early (); /* Catch floating-point math errors. */
init_process_times_very_early (); /* Initialize our process timers.
@@ -1454,9 +1454,9 @@ main_1 (int argc, Wexttext **argv, Wextt
syms_of_abbrev ();
syms_of_alloc ();
-#ifdef MC_ALLOC
+#ifdef NEW_GC
syms_of_mc_alloc ();
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
syms_of_gc ();
#ifdef NEW_GC
syms_of_vdb ();
@@ -1874,9 +1874,9 @@ main_1 (int argc, Wexttext **argv, Wextt
reinit_alloc_early ();
reinit_gc_early ();
reinit_symbols_early ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
reinit_opaque_early ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
reinit_eistring_early ();
reinit_console_type_create_stream ();
@@ -2296,9 +2296,9 @@ main_1 (int argc, Wexttext **argv, Wextt
reinit_vars_of_glyphs_widget ();
reinit_vars_of_insdel ();
reinit_vars_of_lread ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
reinit_vars_of_lstream ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
reinit_vars_of_minibuf ();
#ifdef HAVE_SHLIB
reinit_vars_of_module ();
@@ -3239,9 +3239,9 @@ and announce itself normally when it is
fflush (stdout);
disksave_object_finalization ();
-#ifndef MC_ALLOC
+#ifndef NEW_GC
release_breathing_space ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Tell malloc where start of impure now is */
/* Also arrange for warnings when nearly out of space. */
1.92 +3 -0 XEmacs/xemacs/src/eval.c
Index: eval.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -p -r1.91 -r1.92
--- eval.c 2005/11/25 01:42:00 1.91
+++ eval.c 2006/02/27 16:29:24 1.92
@@ -3835,6 +3835,9 @@ Thus, (funcall 'cons 'x 'y) returns (x .
{
need_to_signal_post_gc = 0;
recompute_funcall_allocation_flag ();
+#ifdef NEW_GC
+ run_finalizers ();
+#endif /* NEW_GC */
run_post_gc_hook ();
}
}
1.107 +1 -1 XEmacs/xemacs/src/event-msw.c
Index: event-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-msw.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -p -r1.106 -r1.107
--- event-msw.c 2005/11/25 01:42:01 1.106
+++ event-msw.c 2006/02/27 16:29:24 1.107
@@ -2502,7 +2502,7 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
/* If you hit this, rewrite the offending API call to occur after GC,
using register_post_gc_action(). */
assert (!gc_in_progress);
-#endif /* NEW_GC */
+#endif /* not NEW_GC */
#ifdef DEBUG_XEMACS
if (debug_mswindows_events)
1.93 +21 -21 XEmacs/xemacs/src/event-stream.c
Index: event-stream.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-stream.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -p -r1.92 -r1.93
--- event-stream.c 2005/10/25 11:16:23 1.92
+++ event-stream.c 2006/02/27 16:29:24 1.93
@@ -329,9 +329,9 @@ static int is_scrollbar_event (Lisp_Obje
#define CHECK_COMMAND_BUILDER(x) CHECK_RECORD (x, command_builder)
#define CONCHECK_COMMAND_BUILDER(x) CONCHECK_RECORD (x, command_builder)
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static Lisp_Object Vcommand_builder_free_list;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static const struct memory_description command_builder_description [] = {
{ XD_LISP_OBJECT, offsetof (struct command_builder, current_events) },
@@ -389,12 +389,12 @@ Lisp_Object
allocate_command_builder (Lisp_Object console, int with_echo_buf)
{
Lisp_Object builder_obj =
-#ifdef MC_ALLOC
+#ifdef NEW_GC
wrap_pointer_1 (alloc_lrecord_type (struct command_builder,
&lrecord_command_builder));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
alloc_managed_lcrecord (Vcommand_builder_free_list);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
struct command_builder *builder = XCOMMAND_BUILDER (builder_obj);
builder->console = console;
@@ -463,12 +463,12 @@ free_command_builder (struct command_bui
xfree (builder->echo_buf, Ibyte *);
builder->echo_buf = NULL;
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (wrap_command_builder (builder));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
free_managed_lcrecord (Vcommand_builder_free_list,
wrap_command_builder (builder));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
static void
@@ -1031,9 +1031,9 @@ static int timeout_id_tick;
static Lisp_Object pending_timeout_list, pending_async_timeout_list;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static Lisp_Object Vtimeout_free_list;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
static Lisp_Object
mark_timeout (Lisp_Object obj)
@@ -1062,12 +1062,12 @@ event_stream_generate_wakeup (unsigned i
Lisp_Object function, Lisp_Object object,
int async_p)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
Lisp_Object op =
wrap_pointer_1 (alloc_lrecord_type (Lisp_Timeout, &lrecord_timeout));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
Lisp_Object op = alloc_managed_lcrecord (Vtimeout_free_list);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
Lisp_Timeout *timeout = XTIMEOUT (op);
EMACS_TIME current_time;
EMACS_TIME interval;
@@ -1185,11 +1185,11 @@ event_stream_resignal_wakeup (int interv
*timeout_list = noseeum_cons (op, *timeout_list);
}
else
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (op);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
free_managed_lcrecord (Vtimeout_free_list, op);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
UNGCPRO;
return id;
@@ -1226,11 +1226,11 @@ event_stream_disable_wakeup (int id, int
signal_remove_async_interval_timeout (timeout->interval_id);
else
event_stream_remove_timeout (timeout->interval_id);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (op);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
free_managed_lcrecord (Vtimeout_free_list, op);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
}
@@ -4925,7 +4925,7 @@ reinit_vars_of_event_stream (void)
recent_keys_ring_index = 0;
recent_keys_ring_size = 100;
num_input_chars = 0;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
Vtimeout_free_list = make_lcrecord_list (sizeof (Lisp_Timeout),
&lrecord_timeout);
staticpro_nodump (&Vtimeout_free_list);
@@ -4933,7 +4933,7 @@ reinit_vars_of_event_stream (void)
make_lcrecord_list (sizeof (struct command_builder),
&lrecord_command_builder);
staticpro_nodump (&Vcommand_builder_free_list);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
the_low_level_timeout_blocktype =
Blocktype_new (struct low_level_timeout_blocktype);
something_happened = 0;
1.65 +10 -4 XEmacs/xemacs/src/extents.c
Index: extents.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/extents.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -p -r1.64 -r1.65
--- extents.c 2006/02/21 11:33:45 1.64
+++ extents.c 2006/02/27 16:29:25 1.65
@@ -1269,6 +1269,14 @@ mark_extent_info (Lisp_Object obj)
return Qnil;
}
+#ifdef NEW_GC
+DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info,
+ 0, /*dumpable-flag*/
+ mark_extent_info, internal_object_printer,
+ 0, 0, 0,
+ extent_info_description,
+ struct extent_info);
+#else /* not NEW_GC */
static void
finalize_extent_info (void *header, int for_disksave)
{
@@ -1277,10 +1285,8 @@ finalize_extent_info (void *header, int
if (for_disksave)
return;
-#ifdef NEW_GC
data->soe = 0;
data->extents = 0;
-#else /* not NEW_GC */
if (data->soe)
{
free_soe (data->soe);
@@ -1291,7 +1297,6 @@ finalize_extent_info (void *header, int
free_extent_list (data->extents);
data->extents = 0;
}
-#endif /* not NEW_GC */
}
DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info,
@@ -1300,6 +1305,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("extent-i
finalize_extent_info, 0, 0,
extent_info_description,
struct extent_info);
+#endif /* not NEW_GC */
static Lisp_Object
allocate_extent_info (void)
@@ -7458,7 +7464,7 @@ syms_of_extents (void)
INIT_LRECORD_IMPLEMENTATION (extent_list_marker);
INIT_LRECORD_IMPLEMENTATION (extent_list);
INIT_LRECORD_IMPLEMENTATION (stack_of_extents);
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
DEFSYMBOL (Qextentp);
DEFSYMBOL (Qextent_live_p);
1.17 +1 -1 XEmacs/xemacs/src/faces.h
Index: faces.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/faces.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- faces.h 2005/11/26 11:46:08 1.16
+++ faces.h 2006/02/27 16:29:25 1.17
@@ -119,7 +119,7 @@ struct face_cachel
{
#ifdef NEW_GC
struct lrecord_header header;
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
/* There are two kinds of cachels; those created from a single face
and those created by merging more than one face. In the former
case, the FACE element specifies the face used. In the latter
1.51 +12 -0 XEmacs/xemacs/src/file-coding.c
Index: file-coding.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -p -r1.50 -r1.51
--- file-coding.c 2005/12/17 19:47:03 1.50
+++ file-coding.c 2006/02/27 16:29:25 1.51
@@ -305,6 +305,7 @@ print_coding_system_in_print_method (Lis
write_c_string (printcharfun, "]");
}
+#ifndef NEW_GC
static void
finalize_coding_system (void *header, int for_disksave)
{
@@ -315,6 +316,7 @@ finalize_coding_system (void *header, in
if (!for_disksave) /* see comment in lstream.c */
MAYBE_XCODESYSMETH (cs, finalize, (cs));
}
+#endif /* not NEW_GC */
static Bytecount
sizeof_coding_system (const void *header)
@@ -366,14 +368,24 @@ const struct sized_memory_description co
0, coding_system_empty_extra_description_1
};
+#ifdef NEW_GC
DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system,
1, /*dumpable-flag*/
mark_coding_system,
print_coding_system,
+ 0, 0, 0, coding_system_description,
+ sizeof_coding_system,
+ Lisp_Coding_System);
+#else /* not NEW_GC */
+DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("coding-system", coding_system,
+ 1, /*dumpable-flag*/
+ mark_coding_system,
+ print_coding_system,
finalize_coding_system,
0, 0, coding_system_description,
sizeof_coding_system,
Lisp_Coding_System);
+#endif /* not NEW_GC */
/************************************************************************/
/* Creating coding systems */
1.2 +95 -18 XEmacs/xemacs/src/gc.c
Index: gc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gc.c 2005/11/25 01:42:03 1.1
+++ gc.c 2006/02/27 16:29:26 1.2
@@ -632,15 +632,15 @@ lispdesc_block_size_1 (const void *obj,
}
#endif /* defined (USE_KKCC) || defined (PDUMP) */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define GC_CHECK_NOT_FREE(lheader) \
gc_checking_assert (! LRECORD_FREE_P (lheader));
-#else /* MC_ALLOC */
+#else /* not NEW_GC */
#define GC_CHECK_NOT_FREE(lheader) \
gc_checking_assert (! LRECORD_FREE_P (lheader)); \
gc_checking_assert (LHEADER_IMPLEMENTATION (lheader)->basic_p || \
! ((struct old_lcrecord_header *) lheader)->free)
-#endif /* MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef USE_KKCC
/* The following functions implement the new mark algorithm.
@@ -1147,13 +1147,13 @@ kkcc_marking (
though. */
if (EQ (*stored_obj, Qnull_pointer))
break;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
mark_object_maybe_checking_free (*stored_obj, 0, level, pos);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
mark_object_maybe_checking_free
(*stored_obj, (desc1->flags) & XD_FLAG_FREE_LISP_OBJECT,
level, pos);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
break;
}
case XD_LISP_OBJECT_ARRAY:
@@ -1169,14 +1169,14 @@ kkcc_marking (
if (EQ (*stored_obj, Qnull_pointer))
break;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
mark_object_maybe_checking_free
(*stored_obj, 0, level, pos);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
mark_object_maybe_checking_free
(*stored_obj, (desc1->flags) & XD_FLAG_FREE_LISP_OBJECT,
level, pos);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
break;
}
@@ -1392,6 +1392,76 @@ run_post_gc_actions (void)
}
}
+#ifdef NEW_GC
+/* Asynchronous finalization. */
+typedef struct finalize_elem
+{
+ Lisp_Object obj;
+ struct finalize_elem *next;
+} finalize_elem;
+
+finalize_elem *Vall_finalizable_objs;
+Lisp_Object Vfinalizers_to_run;
+
+void
+add_finalizable_obj (Lisp_Object obj)
+{
+ finalize_elem *next = Vall_finalizable_objs;
+ Vall_finalizable_objs =
+ (finalize_elem *) xmalloc_and_zero (sizeof (finalize_elem));
+ Vall_finalizable_objs->obj = obj;
+ Vall_finalizable_objs->next = next;
+}
+
+void
+register_for_finalization (void)
+{
+ finalize_elem *rest = Vall_finalizable_objs;
+
+ if (!rest)
+ return;
+
+ while (!marked_p (rest->obj))
+ {
+ finalize_elem *temp = rest;
+ Vfinalizers_to_run = Fcons (rest->obj, Vfinalizers_to_run);
+ Vall_finalizable_objs = rest->next;
+ xfree (temp, finalize_elem *);
+ rest = Vall_finalizable_objs;
+ }
+
+ while (rest->next)
+ {
+ if (LRECORDP (rest->next->obj)
+ && !marked_p (rest->next->obj))
+ {
+ finalize_elem *temp = rest->next;
+ Vfinalizers_to_run = Fcons (rest->next->obj, Vfinalizers_to_run);
+ rest->next = rest->next->next;
+ xfree (temp, finalize_elem *);
+ }
+ else
+ {
+ rest = rest->next;
+ }
+ }
+ /* Keep objects alive that need to be finalized by marking
+ Vfinalizers_to_run transitively. */
+ kkcc_gc_stack_push_lisp_object (Vfinalizers_to_run, 0, -1);
+ kkcc_marking (0);
+}
+
+void
+run_finalizers (void)
+{
+ Lisp_Object rest;
+ for (rest = Vfinalizers_to_run; !NILP (rest); rest = XCDR (rest))
+ {
+ MC_ALLOC_CALL_FINALIZER (XPNTR (XCAR (rest)));
+ }
+ Vfinalizers_to_run = Qnil;
+}
+#endif /* not NEW_GC */
/************************************************************************/
@@ -1514,7 +1584,7 @@ gc_prepare (void)
gc_in_progress = 1;
#ifndef NEW_GC
inhibit_non_essential_conversion_operations = 1;
-#endif /* NEW_GC */
+#endif /* not NEW_GC */
#if MAX_SAVE_STACK > 0
@@ -1596,14 +1666,14 @@ gc_mark_root_set (
**p++;
}
-#ifdef MC_ALLOC
+#ifdef NEW_GC
{ /* mcpro () */
Lisp_Object *p = Dynarr_begin (mcpros);
Elemcount count;
for (count = Dynarr_length (mcpros); count; count--)
mark_object (*p++);
}
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
{ /* GCPRO() */
struct gcpro *tail;
@@ -1708,7 +1778,7 @@ void
gc_finalize (void)
{
GC_SET_PHASE (FINALIZE);
- mc_finalize ();
+ register_for_finalization ();
}
void
@@ -1769,12 +1839,12 @@ gc_finish (void)
}
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
if (!breathing_space)
{
breathing_space = malloc (4096 - MALLOC_OVERHEAD);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
need_to_signal_post_gc = 1;
funcall_allocation_flag = 1;
@@ -1887,12 +1957,12 @@ gc_1 (int incremental)
if (!gc_resume_mark (incremental))
return; /* suspend gc */
gc_finish_mark ();
+ case FINISH_MARK:
+ gc_finalize ();
kkcc_gc_stack_free ();
#ifdef DEBUG_XEMACS
kkcc_bt_free ();
#endif
- case FINISH_MARK:
- gc_finalize ();
case FINALIZE:
gc_sweep ();
case SWEEP:
@@ -2023,12 +2093,16 @@ common_init_gc_early (void)
#ifdef NEW_GC
gc_cons_incremental_threshold = GC_CONS_INCREMENTAL_THRESHOLD;
gc_incremental_traversal_threshold = GC_INCREMENTAL_TRAVERSAL_THRESHOLD;
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
}
void
init_gc_early (void)
{
+#ifdef NEW_GC
+ /* Reset the finalizers_to_run list after pdump_load. */
+ Vfinalizers_to_run = Qnil;
+#endif /* NEW_GC */
}
void
@@ -2174,6 +2248,9 @@ by `gc-message'.
*incremental garbage collection, the garbage collector then only does
*full collects (even if (gc-incremental) is called).
*/ );
+
+ Vfinalizers_to_run = Qnil;
+ staticpro_nodump (&Vfinalizers_to_run);
#endif /* NEW_GC */
}
1.2 +6 -2 XEmacs/xemacs/src/gc.h
Index: gc.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gc.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gc.h 2005/11/25 01:42:04 1.1
+++ gc.h 2006/02/27 16:29:26 1.2
@@ -169,10 +169,14 @@ void complex_vars_of_gc (void);
alloc.c to gc.c. */
void gc_sweep_1 (void);
-#ifndef MC_ALLOC
extern void *breathing_space;
-#endif /* not MC_ALLOC */
#endif /* not NEW_GC */
+
+#ifdef NEW_GC
+void add_finalizable_obj (Lisp_Object obj);
+void register_for_finalization (void);
+void run_finalizers (void);
+#endif /* NEW_GC */
END_C_DECLS
1.42 +1 -1 XEmacs/xemacs/src/glyphs.h
Index: glyphs.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- glyphs.h 2005/11/25 01:42:04 1.41
+++ glyphs.h 2006/02/27 16:29:26 1.42
@@ -1069,7 +1069,7 @@ struct glyph_cachel
{
#ifdef NEW_GC
struct lrecord_header header;
-#endif /* not NEW_GC */
+#endif /* NEW_GC */
Lisp_Object glyph;
unsigned int dirty :1; /* I'm copying faces here. I'm not
1.32 +1 -6 XEmacs/xemacs/src/gui.c
Index: gui.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gui.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- gui.c 2005/10/24 10:07:37 1.31
+++ gui.c 2006/02/27 16:29:26 1.32
@@ -804,15 +804,10 @@ parse_gui_item_tree_list (Lisp_Object li
RETURN_UNGCPRO (ret);
}
-static void
-finalize_gui_item (void *UNUSED (header), int UNUSED (for_disksave))
-{
-}
-
DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item,
0, /*dumpable-flag*/
mark_gui_item, print_gui_item,
- finalize_gui_item, gui_item_equal,
+ 0, gui_item_equal,
gui_item_hash,
gui_item_description,
Lisp_Gui_Item);
1.138 +18 -18 XEmacs/xemacs/src/lisp.h
Index: lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -p -r1.137 -r1.138
--- lisp.h 2006/02/21 11:33:46 1.137
+++ lisp.h 2006/02/27 16:29:26 1.138
@@ -2038,13 +2038,13 @@ DECLARE_MODULE_API_LRECORD (cons, Lisp_C
#define CHECK_CONS(x) CHECK_RECORD (x, cons)
#define CONCHECK_CONS(x) CONCHECK_RECORD (x, cons)
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define CONS_MARKED_P(c) MARKED_P (&((c)->lheader))
#define MARK_CONS(c) MARK (&((c)->lheader))
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define CONS_MARKED_P(c) MARKED_RECORD_HEADER_P(&((c)->lheader))
#define MARK_CONS(c) MARK_RECORD_HEADER (&((c)->lheader))
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
extern MODULE_API Lisp_Object Qnil;
@@ -2637,20 +2637,20 @@ struct Lisp_String
/* WARNING: Everything before ascii_begin must agree exactly with
struct lrecord_header */
unsigned int type :8;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
unsigned int lisp_readonly :1;
unsigned int free :1;
/* Number of chars at beginning of string that are one byte in length
(byte_ascii_p) */
unsigned int ascii_begin :22;
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
unsigned int mark :1;
unsigned int c_readonly :1;
unsigned int lisp_readonly :1;
/* Number of chars at beginning of string that are one byte in length
(byte_ascii_p) */
unsigned int ascii_begin :21;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
} v;
} u;
#ifdef NEW_GC
@@ -2664,11 +2664,11 @@ struct Lisp_String
};
typedef struct Lisp_String Lisp_String;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define MAX_STRING_ASCII_BEGIN ((1 << 22) - 1)
-#else
+#else /* not NEW_GC */
#define MAX_STRING_ASCII_BEGIN ((1 << 21) - 1)
-#endif
+#endif /* not NEW_GC */
DECLARE_MODULE_API_LRECORD (string, Lisp_String);
#define XSTRING(x) XRECORD (x, string, Lisp_String)
@@ -3185,12 +3185,12 @@ DECLARE_LRECORD (float, Lisp_Float);
/*--------------------------- readonly objects -------------------------*/
-#ifndef MC_ALLOC
+#ifndef NEW_GC
#define CHECK_C_WRITEABLE(obj) \
do { if (c_readonly (obj)) c_write_error (obj); } while (0)
#define C_READONLY(obj) (C_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define CHECK_LISP_WRITEABLE(obj) \
do { if (lisp_readonly (obj)) lisp_write_error (obj); } while (0)
@@ -3432,7 +3432,7 @@ Lisp_Object,Lisp_Object,Lisp_Object
/* Can't be const, because then subr->doc is read-only and
Snarf_documentation chokes */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \
Lisp_Object Fname (EXFUN_##max_args); \
static struct Lisp_Subr MC_ALLOC_S##Fname = \
@@ -3474,7 +3474,7 @@ Lisp_Object,Lisp_Object,Lisp_Object
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
wrap_subr (S##Fname);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \
Lisp_Object Fname (EXFUN_##max_args); \
static struct Lisp_Subr S##Fname = \
@@ -3516,7 +3516,7 @@ Lisp_Object,Lisp_Object,Lisp_Object
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
wrap_subr (&S##Fname);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
prototype that matches max_args, and add the obligatory
@@ -4021,7 +4021,7 @@ MODULE_API void unstaticpro_nodump (Lisp
#endif
-#ifdef MC_ALLOC
+#ifdef NEW_GC
extern Lisp_Object_dynarr *mcpros;
#ifdef DEBUG_XEMACS
/* Help debug crashes gc-marking a mcpro'ed object. */
@@ -4031,7 +4031,7 @@ MODULE_API void mcpro_1 (Lisp_Object, ch
/* Call mcpro (&var) to protect mc variable `var'. */
MODULE_API void mcpro (Lisp_Object);
#endif /* not DEBUG_XEMACS */
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
void register_post_gc_action (void (*fun) (void *), void *arg);
int begin_gc_forbidden (void);
@@ -4089,9 +4089,9 @@ MODULE_API EXFUN (Fmake_symbol, 1);
MODULE_API EXFUN (Fmake_vector, 2);
MODULE_API EXFUN (Fvector, MANY);
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void release_breathing_space (void);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object);
MODULE_API Lisp_Object make_vector (Elemcount, Lisp_Object);
MODULE_API Lisp_Object vector1 (Lisp_Object);
1.47 +40 -56 XEmacs/xemacs/src/lrecord.h
Index: lrecord.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- lrecord.h 2005/11/27 10:51:25 1.46
+++ lrecord.h 2006/02/27 16:29:27 1.47
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
#ifndef INCLUDED_lrecord_h_
#define INCLUDED_lrecord_h_
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* The "lrecord" type of Lisp object is used for all object types
other than a few simple ones (like char and int). This allows many
types to be implemented but only a few bits required in a Lisp
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
could contain Lisp_Objects in it), you may well be able to use
the opaque type.
*/
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* The "lrecord" type of Lisp object is used for all object types
other than a few simple ones. This allows many types to be
implemented but only a few bits required in a Lisp object for type
@@ -79,9 +79,9 @@ Boston, MA 02111-1307, USA. */
could contain Lisp_Objects in it), you may well be able to use
the opaque type. --ben
*/
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define ALLOC_LCRECORD_TYPE alloc_lrecord_type
#define COPY_SIZED_LCRECORD copy_sized_lrecord
#define COPY_LCRECORD copy_lrecord
@@ -91,7 +91,7 @@ Boston, MA 02111-1307, USA. */
#define LCRECORD_HEADER lrecord_header
#define BASIC_ALLOC_LCRECORD alloc_lrecord
#define FREE_LCRECORD free_lrecord
-#else
+#else /* not NEW_GC */
#define ALLOC_LCRECORD_TYPE old_alloc_lcrecord_type
#define COPY_SIZED_LCRECORD old_copy_sized_lcrecord
#define COPY_LCRECORD old_copy_lcrecord
@@ -100,7 +100,7 @@ Boston, MA 02111-1307, USA. */
#define LCRECORD_HEADER old_lcrecord_header
#define BASIC_ALLOC_LCRECORD old_basic_alloc_lcrecord
#define FREE_LCRECORD old_free_lcrecord
-#endif
+#endif /* not NEW_GC */
BEGIN_C_DECLS
@@ -111,7 +111,7 @@ struct lrecord_header
field. */
unsigned int type :8;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* 1 if the object is readonly from lisp */
unsigned int lisp_readonly :1;
@@ -125,7 +125,7 @@ struct lrecord_header
anyway. (The bits are used for strings, though.) */
unsigned int uid :22;
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* If `mark' is 0 after the GC mark phase, the object will be freed
during the GC sweep phase. There are 2 ways that `mark' can be 1:
- by being referenced from other objects during the GC mark phase
@@ -145,14 +145,14 @@ struct lrecord_header
anyway. (The bits are used for strings, though.) */
unsigned int uid :21;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
};
struct lrecord_implementation;
int lrecord_type_index (const struct lrecord_implementation *implementation);
extern int lrecord_uid_counter;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define set_lheader_implementation(header,imp) do { \
struct lrecord_header* SLI_header = (header); \
SLI_header->type = (imp)->lrecord_type_index; \
@@ -160,7 +160,7 @@ extern int lrecord_uid_counter;
SLI_header->free = 0; \
SLI_header->uid = lrecord_uid_counter++; \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define set_lheader_implementation(header,imp) do { \
struct lrecord_header* SLI_header = (header); \
SLI_header->type = (imp)->lrecord_type_index; \
@@ -169,9 +169,9 @@ extern int lrecord_uid_counter;
SLI_header->lisp_readonly = 0; \
SLI_header->uid = lrecord_uid_counter++; \
} while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
-#ifndef MC_ALLOC
+#ifndef NEW_GC
struct old_lcrecord_header
{
struct lrecord_header lheader;
@@ -209,7 +209,7 @@ struct free_lcrecord_header
struct old_lcrecord_header lcheader;
Lisp_Object chain;
};
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
enum lrecord_type
{
@@ -226,9 +226,9 @@ enum lrecord_type
lrecord_type_cons,
lrecord_type_vector,
lrecord_type_string,
-#ifndef MC_ALLOC
+#ifndef NEW_GC
lrecord_type_lcrecord_list,
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
lrecord_type_compiled_function,
lrecord_type_weak_list,
lrecord_type_bit_vector,
@@ -297,10 +297,10 @@ enum lrecord_type
lrecord_type_bignum,
lrecord_type_ratio,
lrecord_type_bigfloat,
-#ifndef MC_ALLOC
+#ifndef NEW_GC
lrecord_type_free, /* only used for "free" lrecords */
lrecord_type_undefined, /* only used for debugging */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef NEW_GC
lrecord_type_string_indirect_data,
lrecord_type_string_direct_data,
@@ -400,25 +400,25 @@ struct lrecord_implementation
int (*remprop) (Lisp_Object obj, Lisp_Object prop);
Lisp_Object (*plist) (Lisp_Object obj);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
/* Only one of `static_size' and `size_in_bytes_method' is non-0. */
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* Only one of `static_size' and `size_in_bytes_method' is non-0.
If both are 0, this type is not instantiable by
old_basic_alloc_lcrecord(). */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
Bytecount static_size;
Bytecount (*size_in_bytes_method) (const void *header);
/* The (constant) index into lrecord_implementations_table */
enum lrecord_type lrecord_type_index;
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* A "basic" lrecord is any lrecord that's not an lcrecord, i.e.
one that does not have an old_lcrecord_header at the front and which
is (usually) allocated in frob blocks. */
unsigned int basic_p :1;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
};
/* All the built-in lisp object types are enumerated in `enum lrecord_type'.
@@ -441,7 +441,7 @@ lrecord_implementations_table[lrecord_ty
extern int gc_in_progress;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#include "mc-alloc.h"
#ifdef ALLOC_TYPE_STATS
@@ -453,7 +453,6 @@ int lrecord_stats_heap_size (void);
#endif /* ALLOC_TYPE_STATS */
/* Tell mc-alloc how to call a finalizer. */
-#ifdef NEW_GC
#define MC_ALLOC_CALL_FINALIZER(ptr) \
{ \
Lisp_Object MCACF_obj = wrap_pointer_1 (ptr); \
@@ -470,21 +469,6 @@ int lrecord_stats_heap_size (void);
} \
} \
} while (0)
-#else /* not NEW_GC */
-#define MC_ALLOC_CALL_FINALIZER(ptr) \
-{ \
- Lisp_Object MCACF_obj = wrap_pointer_1 (ptr); \
- struct lrecord_header *MCACF_lheader = XRECORD_LHEADER (MCACF_obj); \
- if (XRECORD_LHEADER (MCACF_obj) && LRECORDP (MCACF_obj) \
- && !LRECORD_FREE_P (MCACF_lheader) ) \
- { \
- const struct lrecord_implementation *MCACF_implementation \
- = LHEADER_IMPLEMENTATION (MCACF_lheader); \
- if (MCACF_implementation && MCACF_implementation->finalizer) \
- MCACF_implementation->finalizer (ptr, 0); \
- } \
-} while (0)
-#endif /* not NEW_GC */
/* Tell mc-alloc how to call a finalizer for disksave. */
#define MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE(ptr) \
@@ -521,7 +505,7 @@ int lrecord_stats_heap_size (void);
#define MARK_LRECORD_AS_LISP_READONLY(ptr) \
((void) (((struct lrecord_header *) ptr)->lisp_readonly = 1))
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define LRECORD_FREE_P(ptr) \
(((struct lrecord_header *) ptr)->type == lrecord_type_free)
@@ -544,7 +528,7 @@ int lrecord_stats_heap_size (void);
} while (0)
#define SET_LISP_READONLY_RECORD_HEADER(lheader) \
((void) ((lheader)->lisp_readonly = 1))
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef USE_KKCC
#define RECORD_DESCRIPTION(lheader) lrecord_memory_descriptions[(lheader)->type]
@@ -1054,14 +1038,14 @@ enum data_description_entry_flags
XD_FLAG_NO_PDUMP = 2,
/* Indicates that this is a "default" entry in a union map. */
XD_FLAG_UNION_DEFAULT_ENTRY = 4,
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* Indicates that this is a free Lisp object we're marking.
Only relevant for ERROR_CHECK_GC. This occurs when we're marking
lcrecord-lists, where the objects have had their type changed to
lrecord_type_free and also have had their free bit set, but we mark
them as normal. */
XD_FLAG_FREE_LISP_OBJECT = 8
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#if 0
,
/* Suggestions for other possible flags: */
@@ -1188,21 +1172,21 @@ MAKE_LRECORD_IMPLEMENTATION(name,c_name,
#define DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \
const struct lrecord_implementation lrecord_##c_name = \
{ name, dumpable, marker, printer, nuker, equal, hash, desc, \
getprop, putprop, remprop, plist, size, sizer, \
lrecord_type_##c_name }
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \
const struct lrecord_implementation lrecord_##c_name = \
{ name, dumpable, marker, printer, nuker, equal, hash, desc, \
getprop, putprop, remprop, plist, size, sizer, \
lrecord_type_##c_name, basic_p }
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,structtype) \
DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
@@ -1216,7 +1200,7 @@ DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEME
#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \
int lrecord_type_##c_name; \
@@ -1224,7 +1208,7 @@ struct lrecord_implementation lrecord_##
{ name, dumpable, marker, printer, nuker, equal, hash, desc, \
getprop, putprop, remprop, plist, size, sizer, \
lrecord_type_last_built_in_type }
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,dumpable,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
DECLARE_ERROR_CHECK_TYPES(c_name, structtype) \
int lrecord_type_##c_name; \
@@ -1232,7 +1216,7 @@ struct lrecord_implementation lrecord_##
{ name, dumpable, marker, printer, nuker, equal, hash, desc, \
getprop, putprop, remprop, plist, size, sizer, \
lrecord_type_last_built_in_type, basic_p }
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#ifdef USE_KKCC
extern MODULE_API const struct memory_description *lrecord_memory_descriptions[];
@@ -1588,7 +1572,7 @@ extern Lisp_Object Q##c_name##p
dead_wrong_type_argument (predicate, x); \
} while (0)
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/*-------------------------- lcrecord-list -----------------------------*/
struct lcrecord_list
@@ -1723,7 +1707,7 @@ void old_free_lcrecord (Lisp_Object rec)
#define old_zero_lcrecord(lcr) old_zero_sized_lcrecord (lcr, sizeof (*(lcr)))
-#else /* MC_ALLOC */
+#else /* NEW_GC */
/* How to allocate a lrecord:
@@ -1767,7 +1751,7 @@ void free_lrecord (Lisp_Object rec);
#define copy_lrecord(dst, src) copy_sized_lrecord (dst, src, sizeof (*(dst)))
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
#define zero_sized_lrecord(lcr, size) \
memset ((char *) (lcr) + sizeof (struct lrecord_header), 0, \
@@ -1886,12 +1870,12 @@ extern MODULE_API int initialized;
#ifdef PDUMP
#include "dumper.h"
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DUMPEDP(adr) 0
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define DUMPEDP(adr) ((((Rawbyte *) (adr)) < pdump_end) && \
(((Rawbyte *) (adr)) >= pdump_start))
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#else
#define DUMPEDP(adr) 0
#endif
1.37 +12 -12 XEmacs/xemacs/src/lstream.c
Index: lstream.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lstream.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- lstream.c 2005/10/25 08:32:48 1.36
+++ lstream.c 2006/02/27 16:29:27 1.37
@@ -180,11 +180,11 @@ Lstream_set_buffering (Lstream *lstr, Ls
}
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
static const Lstream_implementation *lstream_types[32];
static Lisp_Object Vlstream_free_list[32];
static int lstream_type_count;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Allocate and return a new Lstream. This function is not really
meant to be called directly; rather, each stream type should
@@ -196,11 +196,11 @@ Lstream *
Lstream_new (const Lstream_implementation *imp, const char *mode)
{
Lstream *p;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
p = XLSTREAM (wrap_pointer_1
(alloc_lrecord (aligned_sizeof_lstream (imp->size),
&lrecord_lstream)));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
int i;
for (i = 0; i < lstream_type_count; i++)
@@ -220,7 +220,7 @@ Lstream_new (const Lstream_implementatio
}
p = XLSTREAM (alloc_managed_lcrecord (Vlstream_free_list[i]));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Zero it out, except the header. */
memset ((char *) p + sizeof (p->header), '\0',
aligned_sizeof_lstream (imp->size) - sizeof (p->header));
@@ -296,14 +296,14 @@ Lstream_unset_character_mode (Lstream *l
void
Lstream_delete (Lstream *lstr)
{
-#ifndef MC_ALLOC
+#ifndef NEW_GC
int i;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
Lisp_Object val = wrap_lstream (lstr);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (val);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
for (i = 0; i < lstream_type_count; i++)
{
if (lstream_types[i] == lstr->imp)
@@ -314,7 +314,7 @@ Lstream_delete (Lstream *lstr)
}
ABORT ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
#define Lstream_internal_error(reason, lstr) \
@@ -1865,7 +1865,7 @@ lstream_type_create (void)
LSTREAM_HAS_METHOD (lisp_buffer, marker);
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void
reinit_vars_of_lstream (void)
{
@@ -1877,7 +1877,7 @@ reinit_vars_of_lstream (void)
staticpro_nodump (&Vlstream_free_list[i]);
}
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
vars_of_lstream (void)
1.19 +6 -6 XEmacs/xemacs/src/marker.c
Index: marker.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/marker.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- marker.c 2005/10/25 11:16:26 1.18
+++ marker.c 2006/02/27 16:29:27 1.19
@@ -104,7 +104,7 @@ static const struct memory_description m
{ XD_END }
};
-#ifdef MC_ALLOC
+#ifdef NEW_GC
static void
finalize_marker (void *header, int for_disksave)
{
@@ -121,13 +121,13 @@ DEFINE_BASIC_LRECORD_IMPLEMENTATION ("ma
finalize_marker,
marker_equal, marker_hash,
marker_description, Lisp_Marker);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker,
1, /*dumpable-flag*/
mark_marker, print_marker, 0,
marker_equal, marker_hash,
marker_description, Lisp_Marker);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Operations on markers. */
@@ -512,11 +512,11 @@ compute_buffer_marker_usage (struct buff
for (m = BUF_MARKERS (b); m; m = m->next)
total += sizeof (Lisp_Marker);
ovstats->was_requested += total;
-#ifdef MC_ALLOC
+#ifdef NEW_GC
overhead = mc_alloced_storage_size (total, 0);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
overhead = fixed_type_block_overhead (total);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* #### claiming this is all malloc overhead is not really right,
but it has to go somewhere. */
ovstats->malloc_overhead += overhead;
1.8 +3 -100 XEmacs/xemacs/src/mc-alloc.c
Index: mc-alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mc-alloc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- mc-alloc.c 2006/01/21 13:34:21 1.7
+++ mc-alloc.c 2006/02/27 16:29:27 1.8
@@ -403,11 +403,7 @@ mc_allocator_globals_type mc_allocator_g
/* Number of mark bits: minimum 1, maximum 8. */
-#ifdef NEW_GC
#define N_MARK_BITS 2
-#else /* not NEW_GC */
-#define N_MARK_BITS 1
-#endif /* not NEW_GC */
@@ -773,11 +769,9 @@ set_mark_bit (void *ptr, EMACS_INT value
assert (ph && PH_ON_USED_LIST_P (ph));
if (ph)
{
-#ifdef NEW_GC
if (value == BLACK)
if (!PH_BLACK_BIT (ph))
PH_BLACK_BIT (ph) = 1;
-#endif /* NEW_GC */
SET_BIT (ph, get_mark_bit_index (ptr, ph), value);
}
}
@@ -1271,10 +1265,8 @@ remove_page_from_used_list (page_header
{
page_list_header *plh = PH_PLH (ph);
-#ifdef NEW_GC
if (gc_in_progress && PH_PROTECTION_BIT (ph)) ABORT();
/* cleanup: remove memory protection, zero page_header bits. */
-#endif /* not NEW_GC */
#ifdef MEMORY_USAGE_STATS
PLH_TOTAL_CELLS (plh) -= PH_CELLS_ON_PAGE (ph);
@@ -1482,60 +1474,12 @@ mark_free_list (page_header *ph)
free_link *fl = PH_FREE_LIST (ph);
while (fl)
{
-#ifdef NEW_GC
SET_BIT (ph, get_mark_bit_index (fl, ph), BLACK);
-#else /* not NEW_GC */
- SET_BIT (ph, get_mark_bit_index (fl, ph), 1);
-#endif /* not NEW_GC */
fl = NEXT_FREE (fl);
}
}
-/* Finalize a page. You have to tell mc-alloc how to call your
- object's finalizer. Therefore, you have to define the macro
- MC_ALLOC_CALL_FINALIZER(ptr). This macro should do nothing else
- then test if there is a finalizer and call it on the given
- argument, which is the heap address of the object. */
-static void
-finalize_page (page_header *ph)
-{
- EMACS_INT heap_space = (EMACS_INT) PH_HEAP_SPACE (ph);
- EMACS_INT heap_space_step = PH_CELL_SIZE (ph);
- EMACS_INT mark_bit = 0;
- EMACS_INT mark_bit_max_index = PH_CELLS_ON_PAGE (ph);
- unsigned int bit = 0;
-
- mark_free_list (ph);
-#ifdef NEW_GC
- /* ARRAY_BIT_HACK */
- if (PH_ARRAY_BIT (ph))
- for (mark_bit = 0; mark_bit < mark_bit_max_index; mark_bit++)
- {
- GET_BIT (bit, ph, mark_bit * N_MARK_BITS);
- if (bit)
- {
- return;
- }
- }
-#endif /* NEW_GC */
-
- for (mark_bit = 0; mark_bit < mark_bit_max_index; mark_bit++)
- {
- GET_BIT (bit, ph, mark_bit * N_MARK_BITS);
-#ifdef NEW_GC
- if (bit == WHITE)
-#else /* not NEW_GC */
- if (bit == 0)
-#endif /* not NEW_GC */
- {
- EMACS_INT ptr = (heap_space + (heap_space_step * mark_bit));
- MC_ALLOC_CALL_FINALIZER ((void *) ptr);
- }
- }
-}
-
-
/* Finalize a page for disksave. XEmacs calls this routine before it
dumps the heap image. You have to tell mc-alloc how to call your
object's finalizer for disksave. Therefore, you have to define the
@@ -1558,14 +1502,6 @@ finalize_page_for_disksave (page_header
}
-/* Finalizes the heap. */
-void
-mc_finalize (void)
-{
- visit_all_used_page_headers (finalize_page);
-}
-
-
/* Finalizes the heap for disksave. */
void
mc_finalize_for_disksave (void)
@@ -1588,7 +1524,6 @@ sweep_page (page_header *ph)
mark_free_list (ph);
-#ifdef NEW_GC
/* ARRAY_BIT_HACK */
if (PH_ARRAY_BIT (ph))
for (mark_bit = 0; mark_bit < mark_bit_max_index; mark_bit++)
@@ -1601,20 +1536,13 @@ sweep_page (page_header *ph)
return;
}
}
-#endif /* NEW_GC */
for (mark_bit = 0; mark_bit < mark_bit_max_index; mark_bit++)
{
GET_BIT (bit, ph, mark_bit * N_MARK_BITS);
-#ifdef NEW_GC
if (bit == WHITE)
-#else /* not NEW_GC */
- if (bit == 0)
-#endif /* not NEW_GC */
{
-#ifdef NEW_GC
GC_STAT_FREED;
-#endif /* NEW_GC */
remove_cell (heap_space + (heap_space_step * mark_bit), ph);
}
}
@@ -1637,32 +1565,10 @@ mc_sweep (void)
/* Frees the cell pointed to by ptr. */
void
-mc_free (void *ptr)
+mc_free (void *UNUSED (ptr))
{
- page_header *ph;
-
-#ifdef NEW_GC
- /* Do not allow manual freeing while a gc is running. Data is going
- to be freed next gc cycle. */
- if (write_barrier_enabled || gc_in_progress)
- return;
-#endif /* NEW_GC */
-
- ph = get_page_header (ptr);
- assert (ph);
- assert (PH_PLH (ph));
- assert (PLH_LIST_TYPE (PH_PLH (ph)) != FREE_LIST);
-
-#ifdef NEW_GC
- if (PH_ON_USED_LIST_P (ph))
- SET_BIT (ph, get_mark_bit_index (ptr, ph), WHITE);
-#endif /* NEW_GC */
- remove_cell (ptr, ph);
-
- if (PH_CELLS_USED (ph) == 0)
- remove_page_from_used_list (ph);
- else if (PH_CELLS_USED (ph) < PH_CELLS_ON_PAGE (ph))
- move_page_header_to_front (ph);
+ /* Manual frees are not allowed with asynchronous finalization */
+ return;
}
@@ -1871,7 +1777,6 @@ syms_of_mc_alloc (void)
}
-#ifdef NEW_GC
/*--- incremental garbage collector ----------------------------------*/
/* access dirty bit of page header */
@@ -2062,5 +1967,3 @@ object_on_heap_p (void *ptr)
page_header *ph = get_page_header_internal (ptr);
return (ph && PH_ON_USED_LIST_P (ph));
}
-
-#endif /* NEW_GC */
1.4 +0 -21 XEmacs/xemacs/src/mc-alloc.h
Index: mc-alloc.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mc-alloc.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- mc-alloc.h 2005/11/25 01:42:05 1.3
+++ mc-alloc.h 2006/02/27 16:29:27 1.4
@@ -72,7 +72,6 @@ void *mc_realloc_array (void *ptr, size_
/* Garbage collection related functions and macros: */
-#ifdef NEW_GC
enum mark_bit_colors
{
WHITE = 0,
@@ -103,24 +102,7 @@ EMACS_INT get_mark_bit (void *ptr);
#define MARKED_WHITE_P(ptr) (get_mark_bit (ptr) == WHITE)
#define MARKED_GREY_P(ptr) (get_mark_bit (ptr) == GREY)
#define MARKED_BLACK_P(ptr) (get_mark_bit (ptr) == BLACK)
-#else /* not NEW_GC */
-/* Set the mark bit of the object pointed to by ptr to value.*/
-void set_mark_bit (void *ptr, EMACS_INT value);
-/* Return the mark bit of the object pointed to by ptr. */
-EMACS_INT get_mark_bit (void *ptr);
-
-/* mark bit macros */
-/* Returns true if the mark bit of the object pointed to by ptr is set. */
-#define MARKED_P(ptr) (get_mark_bit (ptr) == 1)
-
-/* Marks the object pointed to by ptr (sets the mark bit to 1). */
-#define MARK(ptr) set_mark_bit (ptr, 1)
-
-/* Unmarks the object pointed to by ptr (sets the mark bit to 0). */
-#define UNMARK(ptr) set_mark_bit (ptr, 0)
-#endif /* not NEW_GC */
-
/* The finalizer of every not marked object is called. The macro
MC_ALLOC_CALL_FINALIZER has to be defined and call the finalizer of
the object. */
@@ -150,7 +132,6 @@ Bytecount mc_alloced_storage_size (Bytec
#endif /* MEMORY_USAGE_STATS */
-#ifdef NEW_GC
/* Incremental Garbage Collector / Write Barrier Support: */
/* Return the PAGESIZE the allocator uses. Generally equals to the
@@ -179,8 +160,6 @@ EMACS_INT maybe_mark_black (void *ptr);
/* Only for debugging---not used anywhere in the sources. */
EMACS_INT object_on_heap_p (void *ptr);
-
-#endif /* NEW_GC */
END_C_DECLS
1.22 +12 -12 XEmacs/xemacs/src/opaque.c
Index: opaque.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/opaque.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- opaque.c 2005/10/24 10:07:39 1.21
+++ opaque.c 2006/02/27 16:29:28 1.22
@@ -38,9 +38,9 @@ Boston, MA 02111-1307, USA. */
#include "lisp.h"
#include "opaque.h"
-#ifndef MC_ALLOC
+#ifndef NEW_GC
Lisp_Object Vopaque_ptr_free_list;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
/* Should never, ever be called. (except by an external debugger) */
static void
@@ -162,13 +162,13 @@ DEFINE_LRECORD_IMPLEMENTATION ("opaque-p
Lisp_Object
make_opaque_ptr (void *val)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
Lisp_Object res =
wrap_pointer_1 (alloc_lrecord_type (Lisp_Opaque_Ptr,
&lrecord_opaque_ptr));
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
Lisp_Object res = alloc_managed_lcrecord (Vopaque_ptr_free_list);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
set_opaque_ptr (res, val);
return res;
}
@@ -179,14 +179,14 @@ make_opaque_ptr (void *val)
void
free_opaque_ptr (Lisp_Object ptr)
{
-#ifdef MC_ALLOC
+#ifdef NEW_GC
free_lrecord (ptr);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
free_managed_lcrecord (Vopaque_ptr_free_list, ptr);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void
reinit_opaque_early (void)
{
@@ -194,7 +194,7 @@ reinit_opaque_early (void)
&lrecord_opaque_ptr);
staticpro_nodump (&Vopaque_ptr_free_list);
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
init_opaque_once_early (void)
@@ -202,7 +202,7 @@ init_opaque_once_early (void)
INIT_LRECORD_IMPLEMENTATION (opaque);
INIT_LRECORD_IMPLEMENTATION (opaque_ptr);
-#ifndef MC_ALLOC
+#ifndef NEW_GC
reinit_opaque_early ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
1.60 +11 -11 XEmacs/xemacs/src/print.c
Index: print.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/print.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -p -r1.59 -r1.60
--- print.c 2005/11/25 01:42:06 1.59
+++ print.c 2006/02/27 16:29:28 1.60
@@ -1458,19 +1458,19 @@ default_object_printer (Lisp_Object obj,
if (print_readably)
printing_unreadable_object
("#<%s 0x%x>",
-#ifdef MC_ALLOC
+#ifdef NEW_GC
LHEADER_IMPLEMENTATION (header)->name,
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
LHEADER_IMPLEMENTATION (&header->lheader)->name,
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
header->uid);
write_fmt_string (printcharfun, "#<%s 0x%x>",
-#ifdef MC_ALLOC
+#ifdef NEW_GC
LHEADER_IMPLEMENTATION (header)->name,
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
LHEADER_IMPLEMENTATION (&header->lheader)->name,
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
header->uid);
}
@@ -1692,7 +1692,7 @@ print_internal (Lisp_Object obj, Lisp_Ob
}
}
-#ifndef MC_ALLOC
+#ifndef NEW_GC
if (lheader->type == lrecord_type_free)
{
printing_major_badness (printcharfun, "freed lrecord", 0,
@@ -1705,7 +1705,7 @@ print_internal (Lisp_Object obj, Lisp_Ob
lheader, BADNESS_NO_TYPE);
break;
}
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
else if ((int) (lheader->type) >= lrecord_type_count)
{
printing_major_badness (printcharfun, "illegal lrecord type",
@@ -2222,19 +2222,19 @@ debug_p4 (Lisp_Object obj)
debug_out ("<< bad object type=%d 0x%lx>>", header->type,
(EMACS_INT) header);
else
-#ifdef MC_ALLOC
+#ifdef NEW_GC
debug_out ("#<%s addr=0x%lx uid=0x%lx>",
LHEADER_IMPLEMENTATION (header)->name,
(EMACS_INT) header,
(EMACS_INT) ((struct lrecord_header *) header)->uid);
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
debug_out ("#<%s addr=0x%lx uid=0x%lx>",
LHEADER_IMPLEMENTATION (header)->name,
(EMACS_INT) header,
(EMACS_INT) (LHEADER_IMPLEMENTATION (header)->basic_p ?
((struct lrecord_header *) header)->uid :
((struct old_lcrecord_header *) header)->uid));
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
}
inhibit_non_essential_conversion_operations = 0;
1.22 +4 -4 XEmacs/xemacs/src/ralloc.c
Index: ralloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ralloc.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- ralloc.c 2005/10/25 11:16:27 1.21
+++ ralloc.c 2006/02/27 16:29:28 1.22
@@ -61,9 +61,9 @@ typedef unsigned char *POINTER;
#include "getpagesize.h"
#include <string.h>
-#ifndef MC_ALLOC
+#ifndef NEW_GC
void refill_memory_reserve (void);
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#else /* Not emacs. */
@@ -986,9 +986,9 @@ r_alloc_free (POINTER *ptr)
*ptr = 0;
#ifdef emacs
-#ifndef MC_ALLOC
+#ifndef NEW_GC
refill_memory_reserve ();
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#endif
}
1.44 +12 -4 XEmacs/xemacs/src/specifier.c
Index: specifier.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/specifier.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -r1.43 -r1.44
--- specifier.c 2005/11/25 01:42:06 1.43
+++ specifier.c 2006/02/27 16:29:28 1.44
@@ -295,6 +295,7 @@ print_specifier (Lisp_Object obj, Lisp_O
write_fmt_string (printcharfun, " 0x%x>", sp->header.uid);
}
+#ifndef NEW_GC
static void
finalize_specifier (void *header, int for_disksave)
{
@@ -302,14 +303,11 @@ finalize_specifier (void *header, int fo
/* don't be snafued by the disksave finalization. */
if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching)
{
-#ifdef NEW_GC
- mc_free (sp->caching);
-#else /* not NEW_GC */
xfree (sp->caching, struct specifier_caching *);
-#endif /* not NEW_GC */
sp->caching = 0;
}
}
+#endif /* not NEW_GC */
static int
specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
@@ -438,14 +436,24 @@ const struct sized_memory_description sp
0, specifier_empty_extra_description_1
};
+#ifdef NEW_GC
DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier,
1, /*dumpable-flag*/
mark_specifier, print_specifier,
+ 0, specifier_equal, specifier_hash,
+ specifier_description,
+ sizeof_specifier,
+ Lisp_Specifier);
+#else /* not NEW_GC */
+DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("specifier", specifier,
+ 1, /*dumpable-flag*/
+ mark_specifier, print_specifier,
finalize_specifier,
specifier_equal, specifier_hash,
specifier_description,
sizeof_specifier,
Lisp_Specifier);
+#endif /* not NEW_GC */
/************************************************************************/
/* Creating specifiers */
1.55 +8 -8 XEmacs/xemacs/src/symbols.c
Index: symbols.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symbols.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -p -r1.54 -r1.55
--- symbols.c 2005/10/25 08:32:49 1.54
+++ symbols.c 2006/02/27 16:29:28 1.55
@@ -3252,7 +3252,7 @@ Lisp_Object Qzero;
Lisp_Object Qnull_pointer;
#endif
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/* some losing systems can't have static vars at function scope... */
static const struct symbol_value_magic guts_of_unbound_marker =
{ /* struct symbol_value_magic */
@@ -3270,7 +3270,7 @@ static const struct symbol_value_magic g
0, /* value */
SYMVAL_UNBOUND_MARKER
};
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
init_symbols_once_early (void)
@@ -3302,7 +3302,7 @@ init_symbols_once_early (void)
{
/* Required to get around a GCC syntax error on certain
architectures */
-#ifdef MC_ALLOC
+#ifdef NEW_GC
struct symbol_value_magic *tem = (struct symbol_value_magic *)
mc_alloc (sizeof (struct symbol_value_magic));
MARK_LRECORD_AS_LISP_READONLY (tem);
@@ -3315,9 +3315,9 @@ init_symbols_once_early (void)
inc_lrecord_stats (sizeof (struct symbol_value_magic),
(const struct lrecord_header *) tem);
#endif /* ALLOC_TYPE_STATS */
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
const struct symbol_value_magic *tem = &guts_of_unbound_marker;
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
Qunbound = wrap_symbol_value_magic (tem);
}
@@ -3454,7 +3454,7 @@ check_sane_subr (Lisp_Subr *subr, Lisp_O
#endif
#ifdef HAVE_SHLIB
-#ifndef MC_ALLOC
+#ifndef NEW_GC
/*
* If we are not in a pure undumped Emacs, we need to make a duplicate of
* the subr. This is because the only time this function will be called
@@ -3514,7 +3514,7 @@ do { \
subr = newsubr; \
} \
} while (0)
-#else /* MC_ALLOC */
+#else /* NEW_GC */
/*
* If we have the new allocator enabled, we do not need to make a
* duplicate of the subr. The new allocator already does allocate all
@@ -3552,7 +3552,7 @@ do { \
signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \
} \
} while (0)
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
#else /* ! HAVE_SHLIB */
#define check_module_subr(subr)
#endif
1.17 +6 -6 XEmacs/xemacs/src/symeval.h
Index: symeval.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symeval.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- symeval.h 2005/10/25 08:32:49 1.16
+++ symeval.h 2006/02/27 16:29:29 1.17
@@ -277,7 +277,7 @@ DECLARE_LRECORD (symbol_value_varalias,
DEFUN ("name, Fname, ...); // at top level in foo.c
DEFSUBR (Fname); // in syms_of_foo();
*/
-#ifdef MC_ALLOC
+#ifdef NEW_GC
MODULE_API void defsubr (Lisp_Subr *);
#define DEFSUBR_MC_ALLOC(Fname) \
S##Fname= (struct Lisp_Subr *) mc_alloc (sizeof (struct Lisp_Subr)); \
@@ -309,7 +309,7 @@ do { \
defsubr_macro (S##Fname); \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
/* To define a Lisp primitive function using a C function `Fname', do this:
DEFUN ("name, Fname, ...); // at top level in foo.c
DEFSUBR (Fname); // in syms_of_foo();
@@ -323,7 +323,7 @@ MODULE_API void defsubr (Lisp_Subr *);
*/
MODULE_API void defsubr_macro (Lisp_Subr *);
#define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
MODULE_API void defsymbol_massage_name (Lisp_Object *location,
const char *name);
@@ -396,7 +396,7 @@ MODULE_API void deferror_massage_name_an
MODULE_API void defvar_magic (const char *symbol_name,
const struct symbol_value_forward *magic);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magic_fun) \
do \
{ \
@@ -413,7 +413,7 @@ do \
\
defvar_magic ((lname), I_hate_C); \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) \
do \
{ \
@@ -439,7 +439,7 @@ do \
}; \
defvar_magic ((lname), &I_hate_C); \
} while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
#define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) \
do \
{ \
1.55 +2 -2 XEmacs/xemacs/src/symsinit.h
Index: symsinit.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symsinit.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -p -r1.54 -r1.55
--- symsinit.h 2005/11/26 11:46:10 1.54
+++ symsinit.h 2006/02/27 16:29:29 1.55
@@ -140,9 +140,9 @@ void syms_of_keymap (void);
void syms_of_lread (void);
void syms_of_macros (void);
void syms_of_marker (void);
-#ifdef MC_ALLOC
+#ifdef NEW_GC
void syms_of_mc_alloc (void);
-#endif /* MC_ALLOC */
+#endif /* NEW_GC */
void syms_of_md5 (void);
void syms_of_menubar (void);
void syms_of_menubar_mswindows (void);
1.12 +3 -3 XEmacs/xemacs/src/tests.c
Index: tests.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/tests.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- tests.c 2005/04/08 23:11:33 1.11
+++ tests.c 2006/02/27 16:29:29 1.12
@@ -479,7 +479,7 @@ Test C interface to hash tables.
-#ifdef MC_ALLOC
+#ifdef NEW_GC
#define TESTS_DEFSUBR(Fname) do { \
DEFSUBR_MC_ALLOC (Fname); \
defsubr (S##Fname); \
@@ -487,14 +487,14 @@ Test C interface to hash tables.
Fcons (intern (subr_name (S##Fname)), \
Vtest_function_list); \
} while (0)
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
#define TESTS_DEFSUBR(Fname) do { \
DEFSUBR (Fname); \
Vtest_function_list = \
Fcons (intern (subr_name (&S##Fname)), \
Vtest_function_list); \
} while (0)
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
void
syms_of_tests (void)
1.14 +3 -3 XEmacs/xemacs/src/xemacs.def.in.in
Index: xemacs.def.in.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/xemacs.def.in.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- xemacs.def.in.in 2005/11/30 11:28:58 1.13
+++ xemacs.def.in.in 2006/02/27 16:29:29 1.14
@@ -9,7 +9,7 @@ NAME xemacs.exe
EXPORTS
/* Exported functions */
acons
-#ifdef MC_ALLOC
+#ifdef NEW_GC
alloc_lrecord /* alloc_lrecord_type */
lrecord_subr /* DEFSUBR */
lrecord_symbol_value_forward /* DEFVAR_SYMVAL_FWD */
@@ -17,9 +17,9 @@ lrecord_symbol_value_forward /* DEFVAR_S
mcpro_1 /* mcpro */
#endif
mc_alloc /* DEFSUBR */
-#else /* not MC_ALLOC */
+#else /* not NEW_GC */
alloc_automanaged_lcrecord /* old_alloc_lcrecord_type */
-#endif /* not MC_ALLOC */
+#endif /* not NEW_GC */
apply1
#ifdef USE_ASSERTIONS
assert_failed /* abort(), assert(), etc. */