+DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0,
+ "Return a list of counters that measure how much consing there has been.\n\
+Each of these counters increments for a certain kind of object.\n\
+The counters wrap around from the largest positive integer to zero.\n\
+Garbage collection does not decrease them.\n\
+The elements of the value are as follows:\n\
+ (CONSES FLOATS VECTOR-CELLS SYMBOLS STRING-CHARS MISCS INTERVALS)\n\
+All are in units of 1 = one object consed\n\
+except for VECTOR-CELLS and STRING-CHARS, which count the total length of\n\
+objects consed.\n\
+MISCS include overlays, markers, and some internal types.\n\
+Frames, windows, buffers, and subprocesses count as vectors\n\
+ (but the contents of a buffer's text do not count here).")
+ ()
+{
+ Lisp_Object lisp_cons_cells_consed;
+ Lisp_Object lisp_floats_consed;
+ Lisp_Object lisp_vector_cells_consed;
+ Lisp_Object lisp_symbols_consed;
+ Lisp_Object lisp_string_chars_consed;
+ Lisp_Object lisp_misc_objects_consed;
+ Lisp_Object lisp_intervals_consed;
+
+ XSETINT (lisp_cons_cells_consed,
+ cons_cells_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_floats_consed,
+ floats_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_vector_cells_consed,
+ vector_cells_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_symbols_consed,
+ symbols_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_string_chars_consed,
+ string_chars_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_misc_objects_consed,
+ misc_objects_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+ XSETINT (lisp_intervals_consed,
+ intervals_consed & ~(((EMACS_INT) 1) << (VALBITS - 1)));
+
+ return Fcons (lisp_cons_cells_consed,
+ Fcons (lisp_floats_consed,
+ Fcons (lisp_vector_cells_consed,
+ Fcons (lisp_symbols_consed,
+ Fcons (lisp_string_chars_consed,
+ Fcons (lisp_misc_objects_consed,
+ Fcons (lisp_intervals_consed,
+ Qnil)))))));
+}