if (putenv ((char *) string) != 0)
memory_full (0);
}
-
-/* Return a newly allocated memory block of SIZE bytes, remembering
- to free it when unwinding. */
-void *
-record_xmalloc (size_t size)
-{
- void *p = xmalloc (size);
- record_unwind_protect_ptr (xfree, p);
- return p;
-}
\f
/***********************************************************************
Interval Allocation
doc: /* Create a new cons, give it CAR and CDR as components, and return it. */)
(Lisp_Object car, Lisp_Object cdr)
{
- register Lisp_Object val;
- struct Lisp_Cons *p;
-
- p = xmalloc (sizeof *p);
- SCM_NEWSMOB (p->self, lisp_cons_tag, p);
- XSETCONS (val, p);
- XSETCAR (val, car);
- XSETCDR (val, cdr);
- return val;
+ return scm_cons (car, cdr);
}
/* Make a list of 1, 2, 3, 4 or 5 specified objects. */
lisp_misc_tag = scm_make_smob_type ("elisp-misc", 0);
lisp_string_tag = scm_make_smob_type ("elisp-string", 0);
lisp_vectorlike_tag = scm_make_smob_type ("elisp-vectorlike", 0);
- lisp_cons_tag = scm_make_smob_type ("elisp-cons", 0);
/* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */
void
syms_of_alloc (void)
{
+#include "alloc.x"
+
DEFVAR_INT ("gc-cons-threshold", gc_cons_threshold,
doc: /* Number of bytes of consing between garbage collections.
Garbage collection can happen automatically once this many bytes have been
The time is in seconds as a floating point value. */);
DEFVAR_INT ("gcs-done", gcs_done,
doc: /* Accumulated number of garbage collections done. */);
-
- defsubr (&Scons);
- defsubr (&Slist);
- defsubr (&Svector);
- defsubr (&Sbool_vector);
- defsubr (&Smake_byte_code);
- defsubr (&Smake_list);
- defsubr (&Smake_vector);
- defsubr (&Smake_string);
- defsubr (&Smake_bool_vector);
- defsubr (&Smake_symbol);
- defsubr (&Smake_marker);
- defsubr (&Spurecopy);
- defsubr (&Sgarbage_collect);
}
/* When compiled with GCC, GDB might say "No enum type named