You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* Note that this declares bzero on OSF/1. How dumb. */
#include <signal.h>
/* Nonzero during gc */
int gc_in_progress;
+/* Nonzero means display messages at beginning and end of GC. */
+int garbage_collection_messages;
+
#ifndef VIRT_ADDR_VARIES
extern
#endif /* VIRT_ADDR_VARIES */
XSETFASTINT (len, nargs);
if (!NILP (Vpurify_flag))
- val = make_pure_vector (len);
+ val = make_pure_vector ((EMACS_INT) nargs);
else
val = Fmake_vector (len, Qnil);
p = XVECTOR (val);
}
p = XSYMBOL (val);
p->name = XSTRING (name);
+ p->obarray = Qnil;
p->plist = Qnil;
p->value = Qunbound;
p->function = Qunbound;
struct string_block_head
{
struct string_block *next, *prev;
- int pos;
+ EMACS_INT pos;
};
struct string_block
size = XVECTOR (obj)->size;
if (size & PSEUDOVECTOR_FLAG)
size &= PSEUDOVECTOR_SIZE_MASK;
- vec = XVECTOR (make_pure_vector (size));
+ vec = XVECTOR (make_pure_vector ((EMACS_INT) size));
for (i = 0; i < size; i++)
vec->contents[i] = Fpurecopy (XVECTOR (obj)->contents[i]);
if (COMPILEDP (obj))
Returns info on amount of space in use:\n\
((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS)\n\
(USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS\n\
- (USED-FLOATS . FREE-FLOATS))\n\
+ (USED-FLOATS . FREE-FLOATS) (USED-INTERVALS . FREE-INTERVALS))\n\
Garbage collection happens automatically if you cons more than\n\
`gc-cons-threshold' bytes of Lisp data since previous garbage collection.")
()
}
#endif /* MAX_SAVE_STACK > 0 */
- if (!noninteractive)
+ if (garbage_collection_messages)
message1_nolog ("Garbage collecting...");
/* Don't keep command history around forever */
gc_in_progress = 1;
-/* clear_marks (); */
+ /* clear_marks (); */
/* In each "large string", set the MARKBIT of the size field.
That enables mark_object to recognize them. */
XUNMARK (buffer_defaults.name);
XUNMARK (buffer_local_symbols.name);
-/* clear_marks (); */
+ /* clear_marks (); */
gc_in_progress = 0;
consing_since_gc = 0;
if (gc_cons_threshold < 10000)
gc_cons_threshold = 10000;
- if (omessage || minibuf_level > 0)
- message2_nolog (omessage, omessage_length);
- else if (!noninteractive)
- message1_nolog ("Garbage collecting...done");
+ if (garbage_collection_messages)
+ {
+ if (omessage || minibuf_level > 0)
+ message2_nolog (omessage, omessage_length);
+ else
+ message1_nolog ("Garbage collecting...done");
+ }
return Fcons (Fcons (make_number (total_conses),
make_number (total_free_conses)),
make_number (total_free_markers)),
Fcons (make_number (total_string_size),
Fcons (make_number (total_vector_size),
-
+ Fcons (Fcons
#ifdef LISP_FLOAT_TYPE
- Fcons (Fcons (make_number (total_floats),
- make_number (total_free_floats)),
- Qnil)
+ (make_number (total_floats),
+ make_number (total_free_floats)),
#else /* not LISP_FLOAT_TYPE */
- Qnil
+ (make_number (0), make_number (0)),
#endif /* not LISP_FLOAT_TYPE */
- )))));
+ Fcons (Fcons
+#ifdef USE_TEXT_PROPERTIES
+ (make_number (total_intervals),
+ make_number (total_free_intervals)),
+#else /* not USE_TEXT_PROPERTIES */
+ (make_number (0), make_number (0)),
+#endif /* not USE_TEXT_PROPERTIES */
+ Qnil)))))));
}
\f
#if 0
objptr = (Lisp_Object *) &ptr1->contents[COMPILED_CONSTANTS];
goto loop;
}
-#ifdef MULTI_FRAME
else if (GC_FRAMEP (obj))
{
/* See comment above under Lisp_Vector for why this is volatile. */
mark_object (&ptr->name);
mark_object (&ptr->icon_name);
+ mark_object (&ptr->title);
mark_object (&ptr->focus_frame);
mark_object (&ptr->selected_window);
mark_object (&ptr->minibuffer_window);
mark_object (&ptr->menu_bar_vector);
mark_object (&ptr->buffer_predicate);
}
-#endif /* MULTI_FRAME */
else if (GC_BOOL_VECTOR_P (obj))
- ;
+ {
+ register struct Lisp_Vector *ptr = XVECTOR (obj);
+
+ if (ptr->size & ARRAY_MARK_FLAG)
+ break; /* Already marked */
+ ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */
+ }
else
{
register struct Lisp_Vector *ptr = XVECTOR (obj);
DEFVAR_INT ("pure-bytes-used", &pureptr,
"Number of bytes of sharable Lisp data allocated so far.");
+ DEFVAR_INT ("cons-cells-consed", &cons_cells_consed,
+ "Number of cons cells that have been consed so far.");
+
+ DEFVAR_INT ("floats-consed", &floats_consed,
+ "Number of floats that have been consed so far.");
+
+ DEFVAR_INT ("vector-cells-consed", &vector_cells_consed,
+ "Number of vector cells that have been consed so far.");
+
+ DEFVAR_INT ("symbols-consed", &symbols_consed,
+ "Number of symbols that have been consed so far.");
+
+ DEFVAR_INT ("string-chars-consed", &string_chars_consed,
+ "Number of string characters that have been consed so far.");
+
+ DEFVAR_INT ("misc-objects-consed", &misc_objects_consed,
+ "Number of miscellaneous objects that have been consed so far.");
+
+ DEFVAR_INT ("intervals-consed", &intervals_consed,
+ "Number of intervals that have been consed so far.");
+
#if 0
DEFVAR_INT ("data-bytes-used", &malloc_sbrk_used,
"Number of bytes of unshared memory allocated in this session.");
which includes both saved text and other data.");
undo_strong_limit = 30000;
+ DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages,
+ "Non-nil means display messages at start and end of garbage collection.");
+ garbage_collection_messages = 0;
+
/* We build this in advance because if we wait until we need it, we might
not be able to allocate the memory to hold it. */
memory_signal_data