/* Storage allocation and gc for GNU Emacs Lisp interpreter.
- Copyright (C) 1985,86,88,93,94,95,97,98,1999,2000,01,02,03,2004
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
+ 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#ifndef HAVE_SHM
-/* Force it into data space! Initialize it to a nonzero value;
- otherwise some compilers put it into BSS. */
+/* Initialize it to a nonzero value to force it into data space
+ (rather than bss space). That way unexec will remap it into text
+ space (pure), on some systems. We have not implemented the
+ remapping on more recent systems because this is less important
+ nowadays than in the days of small memories and timesharing. */
EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = {1,};
#define PUREBEG (char *) pure
p->dogc = 0;
xfree (p->pointer);
p->pointer = 0;
+ free_misc (arg);
return Qnil;
}
return val;
}
+/* Get an error now if there's any junk in the cons free list. */
+void
+check_cons_list ()
+{
+ struct Lisp_Cons *tail = cons_free_list;
+
+#if 0
+ while (tail)
+ tail = *(struct Lisp_Cons **)&tail->cdr;
+#endif
+}
/* Make a list of 2, 3, 4 or 5 specified objects. */
marker_block = new;
marker_block_index = 0;
n_marker_blocks++;
+ total_free_markers += MARKER_BLOCK_SIZE;
}
XSETMISC (val, &marker_block->markers[marker_block_index]);
marker_block_index++;
}
+ --total_free_markers;
consing_since_gc += sizeof (union Lisp_Misc);
misc_objects_consed++;
XMARKER (val)->gcmarkbit = 0;
return val;
}
+/* Free a Lisp_Misc object */
+
+void
+free_misc (misc)
+ Lisp_Object misc;
+{
+ XMISC (misc)->u_marker.type = Lisp_Misc_Free;
+ XMISC (misc)->u_free.chain = marker_free_list;
+ marker_free_list = XMISC (misc);
+
+ total_free_markers++;
+}
+
/* Return a Lisp_Misc_Save_Value object containing POINTER and
INTEGER. This is used to package C values to call record_unwind_protect.
The unwind function can get the C values back using XSAVE_VALUE. */
Lisp_Object marker;
{
unchain_marker (XMARKER (marker));
-
- XMISC (marker)->u_marker.type = Lisp_Misc_Free;
- XMISC (marker)->u_free.chain = marker_free_list;
- marker_free_list = XMISC (marker);
-
- total_free_markers++;
+ free_misc (marker);
}
\f
for (i = 0; i < staticidx; i++)
mark_object (*staticvec[i]);
+ for (bind = specpdl; bind != specpdl_ptr; bind++)
+ {
+ mark_object (bind->symbol);
+ mark_object (bind->old_value);
+ }
+ mark_kboards ();
+ mark_ttys ();
+
+#ifdef USE_GTK
+ {
+ extern void xg_mark_data ();
+ xg_mark_data ();
+ }
+#endif
+
#if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \
|| GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
mark_stack ();
#endif
mark_byte_stack ();
- for (bind = specpdl; bind != specpdl_ptr; bind++)
- {
- mark_object (bind->symbol);
- mark_object (bind->old_value);
- }
for (catch = catchlist; catch; catch = catch->next)
{
mark_object (catch->tag);
mark_object (handler->var);
}
mark_backtrace ();
- mark_kboards ();
- mark_ttys ();
#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
mark_stack ();
#endif
-#ifdef USE_GTK
- {
- extern void xg_mark_data ();
- xg_mark_data ();
- }
-#endif
-
/* Everything is now marked, except for the things that require special
finalization, i.e. the undo_list.
Look thru every buffer's undo list
break;
case Lisp_Misc_Save_Value:
+#if GC_MARK_STACK
{
register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
/* If DOGC is set, POINTER is the address of a memory
mark_maybe_object (*p);
}
}
+#endif
break;
case Lisp_Misc_Overlay: