+2001-05-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
+ * eval.c (scm_init_eval): Initialize scm_undefineds and
+ scm_listofnull.
+
+ * gc.c (scm_debug_newcell, scm_debug_newcell2): Fixed to behave
+ like the SCM_NEWCELL macro counterparts.
+
+ (scm_init_storage, scm_init_gc): Moved initialization of
+ scm_tc16_allocated from scm_init_gc to scm_init_storage.
+
+ (scm_init_storage): Moved initialization of scm_undefineds and
+ scm_listofnull to eval.c, initializion of scm_nullstr to
+ strings.c, initializion of scm_nullvect to vectors.c.
+
+ * gc.h (SCM_NEWCELL, SCM_NEWCELL2): Prefer SCM_NULLP over
+ SCM_IMP, as in scm_debug_newcell and scm_debug_newcell2.
+
+ * init.c (scm_init_guile_1): Reordered some initializations and
+ added dependcy information comments.
+
+ * load.c (scm_init_load): Use scm_nullstr.
+
+ * strings.c (scm_init_strings): Initialize scm_nullstr.
+
+ * vectors.c (scm_init_vectors): Initialize scm_nullvect.
+
2001-05-15 Marius Vollmer <mvo@zagadka.ping.de>
* values.c (print_values): Print as a unreadable object, not as
scm_set_smob_mark (scm_tc16_promise, scm_markcdr);
scm_set_smob_print (scm_tc16_promise, promise_print);
+ /* Dirk:Fixme:: make scm_undefineds local to eval.c: it's only used here. */
+ scm_undefineds = scm_cons (SCM_UNDEFINED, SCM_EOL);
+ SCM_SETCDR (scm_undefineds, scm_undefineds);
+ scm_listofnull = scm_cons (SCM_EOL, SCM_EOL);
+
scm_f_apply = scm_make_subr ("apply", scm_tc7_lsubr_2, scm_apply);
scm_lisp_nil = scm_sysintern ("nil", SCM_UNDEFINED);
SCM_SETCDR (scm_lisp_t, SCM_CAR (scm_lisp_t));
scm_lisp_t = SCM_CAR (scm_lisp_t);
- /* acros */
- /* end of acros */
-
#if SCM_DEBUG_DEPRECATED == 0
scm_top_level_lookup_closure_var =
scm_sysintern ("*top-level-lookup-closure*", scm_make_fluid ());
/* The rest of this is supposed to be identical to the SCM_NEWCELL
macro. */
if (SCM_NULLP (scm_freelist))
- new = scm_gc_for_newcell (&scm_master_freelist, &scm_freelist);
+ {
+ new = scm_gc_for_newcell (&scm_master_freelist, &scm_freelist);
+ SCM_GC_SET_ALLOCATED (new);
+ }
else
{
new = scm_freelist;
scm_freelist = SCM_FREE_CELL_CDR (scm_freelist);
+ SCM_GC_SET_ALLOCATED (new);
}
return new;
/* The rest of this is supposed to be identical to the SCM_NEWCELL
macro. */
if (SCM_NULLP (scm_freelist2))
- new = scm_gc_for_newcell (&scm_master_freelist2, &scm_freelist2);
+ {
+ new = scm_gc_for_newcell (&scm_master_freelist2, &scm_freelist2);
+ SCM_GC_SET_ALLOCATED (new);
+ }
else
{
new = scm_freelist2;
scm_freelist2 = SCM_FREE_CELL_CDR (scm_freelist2);
+ SCM_GC_SET_ALLOCATED (new);
}
return new;
scm_sizet init_heap_size_2;
scm_sizet j;
+#if (SCM_DEBUG_CELL_ACCESSES == 1)
+ scm_tc16_allocated = scm_make_smob_type ("allocated cell", 0);
+#endif /* SCM_DEBUG_CELL_ACCESSES == 1 */
+
j = SCM_NUM_PROTECTS;
while (j)
scm_sys_protects[--j] = SCM_BOOL_F;
#endif
#endif
- scm_undefineds = scm_cons (SCM_UNDEFINED, SCM_EOL);
- SCM_SETCDR (scm_undefineds, scm_undefineds);
-
- scm_listofnull = scm_cons (SCM_EOL, SCM_EOL);
- scm_nullstr = scm_allocate_string (0);
- scm_nullvect = scm_c_make_vector (0, SCM_UNDEFINED);
-
#define DEFAULT_SYMHASH_SIZE 277
scm_symhash = scm_c_make_hash_table (DEFAULT_SYMHASH_SIZE);
scm_symhash_vars = scm_c_make_hash_table (DEFAULT_SYMHASH_SIZE);
{
SCM after_gc_thunk;
-#if (SCM_DEBUG_CELL_ACCESSES == 1)
- scm_tc16_allocated = scm_make_smob_type ("allocated cell", 0);
-#endif /* SCM_DEBUG_CELL_ACCESSES == 1 */
-
/* Dirk:FIXME:: scm_create_hook is strange. */
scm_after_gc_hook = scm_create_hook ("after-gc-hook", 0);
a freelist of its own. */
#define SCM_NEWCELL(_into) \
do { \
- if (SCM_IMP (scm_freelist)) \
+ if (SCM_NULLP (scm_freelist)) \
{ \
_into = scm_gc_for_newcell (&scm_master_freelist, \
&scm_freelist); \
} while(0)
#define SCM_NEWCELL2(_into) \
do { \
- if (SCM_IMP (scm_freelist2)) \
+ if (SCM_NULLP (scm_freelist2)) \
{ \
_into = scm_gc_for_newcell (&scm_master_freelist2, \
&scm_freelist2); \
#ifdef GUILE_DEBUG_MALLOC
scm_debug_malloc_prehistory ();
#endif
- scm_init_storage ();
+ scm_init_storage (); /* requires smob_prehistory */
scm_struct_prehistory (); /* requires storage */
scm_symbols_prehistory (); /* requires storage */
scm_weaks_prehistory (); /* requires storage */
scm_init_srcprop ();
#endif
scm_init_stackchk ();
- scm_init_struct ();
- scm_init_stacks (); /* Requires struct */
+ scm_init_strings ();
+ scm_init_struct (); /* Requires strings */
+ scm_init_stacks (); /* Requires strings, struct */
scm_init_symbols ();
scm_init_tag ();
scm_init_values (); /* Requires struct */
- scm_init_load ();
+ scm_init_load (); /* Requires strings */
scm_init_objects (); /* Requires struct */
- scm_init_print (); /* Requires struct */
+ scm_init_print (); /* Requires strings, struct */
scm_init_read ();
scm_init_stime ();
- scm_init_strings ();
scm_init_strorder ();
scm_init_strop ();
scm_init_throw ();
scm_loc_load_extensions
= SCM_CDRLOC (scm_sysintern ("%load-extensions",
SCM_LIST2 (scm_makfrom0str (".scm"),
- scm_makfrom0str (""))));
+ scm_nullstr)));
scm_loc_load_hook = SCM_CDRLOC (scm_sysintern ("%load-hook", SCM_BOOL_F));
init_build_info ();
#include "libguile/_scm.h"
#include "libguile/chars.h"
-
+#include "libguile/root.h"
#include "libguile/strings.h"
#include "libguile/validate.h"
\f
void
scm_init_strings ()
{
+ scm_nullstr = scm_allocate_string (0);
+
#ifndef SCM_MAGIC_SNARFER
#include "libguile/strings.x"
#endif
void
scm_init_vectors ()
{
+ scm_nullvect = scm_c_make_vector (0, SCM_UNDEFINED);
+
#ifndef SCM_MAGIC_SNARFER
#include "libguile/vectors.x"
#endif