1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

165 commits

Author SHA1 Message Date
Dirk Herrmann
d1ca2c6423 * Some more work to get rid of SCM_LENGTH
* Eliminated some cell type bit fiddling
* Various minor changes
2000-10-25 11:01:03 +00:00
Marius Vollmer
9208204554 * gc.h (scm_get_stack_base): Added prototype. 2000-10-11 19:20:14 +00:00
Michael Livshin
3c8018e61e * gc.h: removed now-obsolete comments about the `allocated' cell
state.
(SCM_NEWCELL): don't change cell type to `allocated'.
(SCM_NEWCELL2): ditto.
2000-09-02 21:53:02 +00:00
Michael Livshin
f91f77e64e * gc.h (SCM_GC_CARD_N_CELLS): change to be a nice non-confusing
constant.
2000-08-21 10:06:45 +00:00
Michael Livshin
35e9b48d79 * gc.h: removed some stuff that broke compilation for people and
wasn't actually needed anyway.
2000-08-18 22:33:37 +00:00
Michael Livshin
e618c9a3c8 * gc.h (SCM_MARKEDP): simplified, there are no different mark bit
locations anymore.
(SCM_GC_CARD_*, SCM_C_BVEC_*): lots of new macros to deal with
cards and bvecs (bit-vectors).
2000-08-17 20:38:23 +00:00
Michael Livshin
c9b0d4b090 * gc.c (scm_gc_stats): add more obscure stats, such as: mark time,
sweep time, total marked cells, total swept cells, and number of
times GC was invoked.
(gc_start_stats): renamed from scm_gc_start, made static, taught
to init the new stats.
(gc_end_stats): renamed from scm_gc_end, made static, taught to
calculate the new stats.
(scm_igc): don't call gc_start_stats unless we are sure that we
are indeed going to collect.  also, added some timekeeping between
the mark and sweep phases.
(scm_gc_sweep): count number of cells we sweep as we go.

* gc.h: removed prototypes for scm_gc_{start,end}.
2000-08-16 00:23:18 +00:00
Dirk Herrmann
78a3503e56 * Fixed some type-related errors. 2000-07-18 16:59:35 +00:00
Michael Livshin
9d47a1e6f2 * gc.c (scm_done_free): new.
expanded comments about scm_done_malloc.

* gc.h: added prototype for scm_done_free
2000-07-15 13:44:04 +00:00
Dirk Herrmann
406c7d9022 * Extend checks performed with SCM_DEBUG_CELL_ACCESSES=1 and make them
configurable at run-time.
* Replace SCM_FREEP by SCM_FREE_CELL_P and scm_gc_heap_lock by
  scm_gc_running_p (not in all places yet).
2000-07-13 15:00:58 +00:00
Dirk Herrmann
3f5d82cd9a * Use a set of dedicated macros to access and modify free cells. 2000-07-10 14:25:53 +00:00
Dirk Herrmann
f706a58b67 * Make the compiler warn about code like SCM_CELL_WORD (x, n) = y. 2000-07-10 13:54:03 +00:00
Mikael Djurfeldt
076d6063fa * gc.h, tags.h: Be kind to compilers which must see hash signs in
column 0.  (Thanks to Ian Grant.)
2000-06-20 14:57:55 +00:00
Mikael Djurfeldt
aeacfc8fd1 * gc.c, gc.h (scm_default_init_heap_size_1,
scm_default_min_yield_1, scm_default_init_heap_size_2,
scm_default_min_yield_2, scm_default_max_segment_size): New global
variables.  Can be customized by the application before booting
Guile.  (We might want to be able to control these parameters
dynamically through the "options interface" in the future, but
note that that is additional functionality.  Here we're giving
default values which the environment variables can override.)
2000-06-20 02:37:23 +00:00
Mikael Djurfeldt
708cb87c6e * gc.h (SCM_VALIDATE_CELL): Rewritten.
(SCM_CELL_WORD, SCM_CELL_OBJECT, SCM_SET_CELL_WORD,
SCM_SET_CELL_OBJECT): Use new version of SCM_VALIDATE_CELL.
(Thanks to Han-Wen Nienhuys.)
2000-06-11 19:50:09 +00:00
Dirk Herrmann
4b479d9818 * gh.h: Don't take the address of a SCM value.
* sort.c: Don't take the address of SCM_CAR, use SCM_CARLOC instead.
2000-06-05 12:09:35 +00:00
Mikael Djurfeldt
05a85bae79 * gc.h (SCM_VALIDATE_CELL): Cast result to (void) in order to
avoid compiler warnings in gcc.  (Does this work for other
compilers?)
2000-06-03 00:17:31 +00:00
Mikael Djurfeldt
217883aa45 * gc.h (SCM_VALIDATE_CELL): Don't "use" the value returned by
abort ().
(SCM_CARLOC, SCM_CDRLOC): Define directly instead of using
SCM_CELL_OBJECT_0 and SCM_CELL_OBJECT_1.  It's not correct to take
the address of these expressions since they use SCM_VALIDATE_CELL.
(Thanks to Bernard Urban.)
2000-06-02 23:47:11 +00:00
Dirk Herrmann
6ba93e5e88 * Deprecated some unused SCM_NxxxP macros.
* Removed conditionally compiled code depending on 'nosve'.
2000-05-23 15:20:54 +00:00
Michael Livshin
a564e775fc * guile-doc-snarf.in: put the preprocessed file through sed to
trim all lines to 512 chars.  I hope it doesn't break anybody's
shell.  we'll see.

* gc.h (SCM_[SET_]CELL_{WORD,OBJECT}, SCM_VALIDATE_CELL): reverted
the previous change to this macros, after deciding to torture the
snarfer instead.
2000-05-22 14:03:37 +00:00
Michael Livshin
686765af61 * gc.h (SCM_[SET_]CELL_{WORD,OBJECT}, SCM_VALIDATE_CELL): brought
the yucky, ugly and nasty conditional compilation back.  sorry,
but it was either that or requiring GAWK to build Guile.
removed the code that implemented the old GC scheme.

* init.c (scm_boot_guile_1): removed the code conditioned on
!GUILE_NEW_GC_SCHEME.

* __scm.h: (GUILE_NEW_GC_SCHEME): removed.

* gc.c (scm_protect_object, scm_unprotect_object): change the
implementation to more efficient (at least in the time complexity
sense).  the calls should now also be thread-safe -- I suspect
that people expect them to be.  (thanks to Han-Wen Nienhuys)
removed the code that implemented the old GC scheme.

* hashtab.c (scm_hash_fn_create_handle_x): add missing
SCM_REALLOW_INTS before return.
2000-05-21 20:49:20 +00:00
Dirk Herrmann
46d53380a2 * Added SCM_DEBUG_CELL_ACCESSES debug option. 2000-05-19 15:46:32 +00:00
Dirk Herrmann
5610071627 * Makefile.am: Let 'make clean' remove *.x and *.doc files.
* Renamed SCM_STRICT_TYPING to SCM_DEBUG_TYPING_STRICTNESS.
* Removed conditionally compiled code for Turbo C.
* gdbint.c:  Eliminated call to scm_tag.
2000-05-16 12:11:08 +00:00
Dirk Herrmann
e828cb75d4 * Scheme cells now consist of scm_bits_t values instead of SCM values.
* Use SCM_SETC[AD]R to modify contents of pairs.
2000-05-10 14:04:48 +00:00
Mikael Djurfeldt
9b3e180c0d * gc.h: Added #include "libguile/hooks.h". 2000-04-21 23:11:51 +00:00
Dirk Herrmann
2d67e39007 Use SCM_{SET_}?CELL_TYPE when accessing the type entry of a cell. 2000-03-27 22:43:37 +00:00
Dirk Herrmann
2549a7096d Moved some cell related definitions from tags.h and pairs.h to gc.h. 2000-03-26 10:08:52 +00:00
Mikael Djurfeldt
8b0d194f91 * gc.c, gc.h (scm_gc_yield): New variable.
(adjust_gc_trigger): Use scm_gc_yield.
(alloc_some_heap): Use scm_gc_yield instead of
scm_gc_cells_collected.
2000-03-19 21:00:30 +00:00
Michael Livshin
89e00824a0 * *.[hc]: add Emacs magic at the end of file, to ensure GNU
indentation style.
2000-03-19 19:01:16 +00:00
Michael Livshin
a00c95d9c6 * tags.h: (SCM_DOUBLE_CELLP, SCM_NDOUBLE_CELLP): new macros.
* gc.h: (typedef struct scm_freelist_t) remove from here.

* gc.c: (CELL_UP, CELL_DN) make these macros take additional
parameter (the span).
(CLUSTER_SIZE_IN_BYTES, ALIGNMENT_SLACK) new macros.
(typedef struct scm_freelist_t) move here from gc.h, it had no
business being externally visible.
(typedef struct scm_heap_seg_data_t) renamed from
scm_heap_seg_data, to be style-compliant.
(scm_mark_locations) if the possible pointer points to a
multy-cell, check that it's properly aligned.
(init_heap_seg) alighn multy-cells properly, work with the
assumption that the segment size divides cleanly by cluster size
(so that there's no spill).
(round_to_cluster_size) new function.
(alloc_some_heap, make_initial_segment) use round_to_cluster_size
to satisfy the new init_heap_seg invariant.
2000-03-18 11:09:41 +00:00
Mikael Djurfeldt
4c48ba0605 * gc.c, gc.h: Cleanup of the change of 2000-03-15.
Cluster sizes are now independent of GC trigger values.
GUILE_GC_TRIGGER_n can now specify a relative trigger value:
A negative integer gives fraction of total heap size in percent.
2000-03-17 08:09:14 +00:00
Mikael Djurfeldt
5384bc5b52 * gc.c, gc.h (scm_map_free_list): Define also if GUILE_DEBUG is
defined.
(scm_free_list_length): New procedure (GUILE_DEBUG).
2000-03-16 03:59:35 +00:00
Mikael Djurfeldt
bb2c57fa98 * gc.c, gc.h (scm_map_free_list): Define also if GUILE_DEBUG is
defined.
2000-03-16 01:29:00 +00:00
Mikael Djurfeldt
dd45c0dfdb Removed some stupid code. 2000-03-15 15:19:50 +00:00
Mikael Djurfeldt
4a4c9785e0 * gc.c, gc.h, pairs.h, init.c: Implementation of a new way of
allocating heap.  The basic idea is to trigger GC every Nth
allocated cell and grow heap when free list runs out.  The scheme
has been extended so that GC isn't triggered until all remaining
cells are used.  The implementation is also prepared for
development in the direction of POSIX threads.

* gc.c (SCM_EXPHEAP): In order to grow by a factor of 1.5,
SCM_EXPHEAP should return half of the heap size.
2000-03-15 07:30:53 +00:00
Mikael Djurfeldt
bb6df2eec3 * gc.h (scm_freelist_t): New type. 2000-03-14 09:03:08 +00:00
Mikael Djurfeldt
16d35552c4 *** empty log message *** 2000-03-14 06:43:57 +00:00
Mikael Djurfeldt
f12677062e *** empty log message *** 2000-03-12 18:30:33 +00:00
Mikael Djurfeldt
413cb56ff4 * async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,
feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h,
  hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c,
  objects.h, options.c, pairs.h, ports.c, ports.h, print.c,
  procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c,
  stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h,
  throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c,
  weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from
  SCM_ASSCM, SCM_ASWORD, SCM_CARW).
2000-03-12 17:00:58 +00:00
Greg J. Badros
41b0806d3e * vectors.h (SCM_VELTS_AS_STACKITEMS): Added this macro to help in
eliminating some warnings.

* unif.c, strports.c, print.c, options.c: Fix some warnings on
mis-use of SCM/long

* gc.c, gc.h: Added scm_return_first_int(), and added comment re:
what the scm_return_first* functions do.
2000-03-09 21:48:25 +00:00
Greg J. Badros
c209c88e54 *.[ch]: make a distinction between SCM as a generic
name for a Scheme object (now a void*), and SCM as 32 bit word for
storing tags and immediates (now a long int).  Introduced
SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious
code in the process: arbiter.c (use macros), unif.c (scm_array_p),
2000-03-09 18:58:58 +00:00
Greg J. Badros
d3a6bc9484 * *.h: Use SCM_NIMP(X) && in all the FOOP macros.
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded
to a bare block.
1999-12-16 03:46:42 +00:00
Greg J. Badros
fca7547b1a Fix my last commit -- DEBUG_FREELIST renamed to GUILE_DEBUG_FREELIST 1999-09-28 00:54:26 +00:00
Greg J. Badros
25748c78cf * stacks.c: Avoid compiler warning re: unitialized var.
* scmconfig.h.in: Added DEBUG_FREELIST

* pairs.h: Fix macro that was not do-while(0) sandwiched.

* gc.h, gc.c: Added scm_gc_set_debug_check_freelist_x,
scm_map_free_list
1999-09-27 23:30:36 +00:00
Jim Blandy
0780669549 Allocators should use the `void *' type for generic pointers.
* gc.c (scm_must_malloc, scm_must_realloc, scm_must_free): Change
argument and return types.
* gc.h: Corresponding changes to prototypes.
(Thanks to Forcer.)
1999-09-01 02:47:30 +00:00
Jim Blandy
a5c314c80e * gc.c (scm_mallocated): Just make this signed.
(scm_igc): Check for underflow by seeing if this is negative.
Much cleaner.
* gc.h (scm_mallocated): Fix declaration.
(Thanks to Greg Harvey.)
1999-06-16 10:18:27 +00:00
Mikael Djurfeldt
8163d1e493 * gc.c, gc.h (scm_object_address): Renamed from scm_object_addr (). 1999-03-11 11:46:07 +00:00
Jim Blandy
3eeba8d4f5 * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
s_clauses, s_formals): Variables now const.
* eval.c (promsmob): Now const.
* macros.c (macrosmob): Now const.
* smob.c (scm_newsmob): Smobfuns argument now points to const.
(freecell, flob, bigob): Now const.
* dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
error.c (scm_error, scm_syserror, scm_syserror_msg,
scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
scm_memory_error, scm_misc_error, scm_wta), macros.c
(scm_make_synt), feature.c (scm_add_feature), filesys.c
(scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
scm_num2long_long, scm_num2ulong),
options.c (scm_options), posix.c (scm_convert_exec_args,
environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
(scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
(setzone, restorezone, bdtime2c), strop.c (scm_i_index),
strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
scm_intern_obarray, scm_intern, scm_intern0,
scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
indicating calling subr, error message text, reason for error,
symbol name or feature name are now pointer to const.
* snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
* procs.c (scm_init_iprocs): iproc argument now points to const.
* pairs.c (cxrs): Now const.
* chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
strports.h, symbols.h, unif.h: Update variable declarations and
function prototypes for above changes.
* dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
SYMB now point to const.
1999-02-06 12:31:04 +00:00
Mikael Djurfeldt
79e3f9e250 * gc.h (SCM_MARKEDP, SCM_NMARKEDP): New macros. 1998-12-23 05:55:01 +00:00
Jim Blandy
f233316662 * pairs.h (SCM_NEWCELL): When DEBUG_FREELIST is defined, don't
take the address of _into; it might be a register.  Just have
scm_debug_newcell return the new cell.
* gc.c (scm_debug_newcell): Just return the new cell, instead of
taking the address of a place to store it as an argument.
* gc.h (scm_debug_newcell): Change declaration.
(Thanks to Greg Harvey.)
1998-12-05 18:52:15 +00:00