1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00
Commit graph

191 commits

Author SHA1 Message Date
Dirk Herrmann
c73879189d * Improved memory error handling.
* Made the behaviour of scm_gc_for_newcell more obvious.
2000-06-30 13:48:28 +00:00
Mikael Djurfeldt
83d58c8257 * gc.c (scm_gc_for_newcell): Behave gracefully also if scm_igc
doesn't yield any new cells.  In theory this could happen if all
cells allocated with NEWCELL are either in use or conservatively
marked and all cluster spine cells are conservatively marked.
(Thanks to Dirk.)
2000-06-29 23:46:59 +00:00
Dirk Herrmann
acf4331fa5 * Use appropriate error signalling functions. 2000-06-29 13:31:33 +00:00
Dirk Herrmann
0a7a74453e * Removed unused identifier MIN_GC_YIELD. 2000-06-29 08:27:40 +00:00
Michael Livshin
150c200bdd * gc.c (scm_gc_for_newcell): don't try to do GC if it's blocked,
allocate instead.
2000-06-28 13:17:11 +00:00
Dirk Herrmann
939794ce7f * Cleaned up initialization of asyncs.
* Moved handling of scm_gc_async to gc.c.
* Extracted handling of scheme level after-gc-hook from gc core.
2000-06-28 10:26:52 +00:00
Dirk Herrmann
12acbbef54 * Removed commented code from gc.c.
* Removed unused identifier scm_type_obj_list.
2000-06-28 07:49:25 +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
7bd4fbe2de * gc.c (scm_protect_object): Updated comment. 2000-06-19 10:03:57 +00:00
Dirk Herrmann
6a19994066 * The reference count in scm_unprotect_object is always positive. 2000-06-15 08:35:42 +00:00
Mikael Djurfeldt
0f0f08998d * gc.c (scm_protect_object): Avoid looking up the object handle
twice.
(scm_unprotect_object): Abort if scm_unprotect_object is called on
an unprotected object.
2000-06-14 15:00:52 +00:00
Michael Livshin
2dd6a83aed * gc.c (scm_unprotect_object): fix a nasty typo bug (thanks to
Dirk Herrmann).
2000-06-14 14:21:49 +00:00
Dirk Herrmann
9a09deb1c3 * Removed SCM_TRUE_P since it may get confused with !SCM_FALSEP. 2000-06-05 11:39:46 +00:00
Dirk Herrmann
f8eaf8b9a3 * Restored the old behaviour of scm_create_hook. 2000-05-29 07:57:31 +00:00
Dirk Herrmann
e11f8b42f2 * The name property of hooks is deprecated. 2000-05-26 16:31:22 +00:00
Dirk Herrmann
47457e8a43 * Replace SCM_UNPACK_CAR appropriately.
* Only access cons cells via SCM_{SET}?C[AD]R.
* gc.c:  Remove unused struct member variable 'valid'.
2000-05-25 09:21:06 +00:00
Dirk Herrmann
206d3de31e * Replace SCM_UNPACK_CAR appropriately. 2000-05-23 22:23:56 +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
fe517a7d3d * gc.c (scm_heap_seg_data_t): fixed comment for the `span' member. 2000-05-23 12:26:55 +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
1a548472dd * gc.c (scm_cellp): Fixed and simplified.
* Using double cells to represent jump buffers with debug extensions.
2000-05-19 14:03:44 +00:00
Mikael Djurfeldt
801cb5e7ce * gc.c: Removed #include "libguile/guardians.h".
(scm_before_gc_c_hook, scm_before_mark_c_hook,
scm_before_sweep_c_hook, scm_after_sweep_c_hook,
scm_after_gc_c_hook): New C level hooks.
(scm_after_gc_hook): New Scheme level hook.
(scm_gc_sweep): Moved scanning of weak vectors to weaks.c.
(scm_igc): Moved initialization of scm_weak_vectors and the call
to scm_guardian_gc_init to respective module.
(scm_mark_weak_vector_spines): Moved to weaks.c;
Call to scm_guardian_zombify moved to guardians.c;
Run scm_before_gc_c_hook, scm_before_sweep_c_hook,
scm_after_gc_c_hook at appropriate places.
(scm_init_gc): Initialize scm_after_gc_hook.
2000-04-21 23:11:29 +00:00
Mikael Djurfeldt
a059974535 * Makefile.am (DEFS): Added. automake adds -I options to DEFS,
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.

* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
2000-04-21 14:16:44 +00:00
Mikael Djurfeldt
bc9d9bb216 * gc.c (scm_must_malloc, scm_must_realloc, scm_must_free): Added
calls to malloc debugging functions.
2000-04-21 00:26:35 +00:00
Dirk Herrmann
195e620170 Some cleanups with regard to the use of SCM2PTR and casts to SCM_CELLPTR. 2000-04-19 16:47:11 +00:00
Dirk Herrmann
c8045e8dbd * struct.c, struct.h: Struct data regions (and thus also vtable data regions)
are now C arrays of scm_bits_t elements.
* gc.c:  Made the mixup of glocs and structs explicit.
2000-04-17 16:25:11 +00:00
Dirk Herrmann
cf551a2be9 The msymbol slots are now a field of scm_bits_t values. 2000-04-12 12:48:11 +00:00
Dirk Herrmann
54778cd312 Lots of fixes to make guile (at some time) compile with strict typing. 2000-04-03 08:47:51 +00:00
Dirk Herrmann
96f6f4aebf Removed use of SCM_POINTERS_MUNGED. 2000-03-25 07:56:53 +00:00
Mikael Djurfeldt
c67baafdd1 * gc.c (scm_mark_locations): Changed * (SCM **) X --> * (SCM *) X
in order to obtain a value of type SCM.
(scm_cellp): Updated with new changes to scm_mark_locations.
2000-03-23 13:04:27 +00:00
Mikael Djurfeldt
890b019c74 * gc.c (scm_gc_sweep): SCM_PACK/UNPACK corrections. 2000-03-22 02:12:24 +00:00
Mikael Djurfeldt
77490b49ab * gc.c (scm_gc_mark): Bugfix 1: The recent SCM_PACK/UNPACK change
made SCM values into pointers.  This turned an arithmetic
computation of the address of the vcell into a pointer-arithmetic
one, thereby screwing up marking of structs.
Bugfix 2: Removed incompletely introduced loop variable `j' used
when protecting the tail array of a struct.
2000-03-21 20:33:18 +00:00
Mikael Djurfeldt
8fef55a81c * gc.c, gc.h (SCM_MIN_YIELD_1, SCM_MIN_YIELD_2,
min_yield_fraction, min_yield, adjust_min_yield): Renamed from
SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2, gc_trigger_fraction,
gc_trigger, adjust_gc_trigger.

* gc.c (SCM_INIT_HEAP_SIZE_1, SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2):
Adjusted to 45000 cells, 40% and 40%.  Gives quick startup
without extra heap allocation.
2000-03-21 03:57:53 +00:00
Mikael Djurfeldt
1811ebcee5 * gc.c (alloc_some_heap): Further improvement of minimal heap size
prediction.
(SCM_MAX): New macro.
(scm_freelist_t): New field: collected_1. Previous amount of
collected cells.
(gc_sweep_freelist_finish): Trigger based on two last values of
freelist->collected to avoid unnecessary allocation due to
temporary peaks.
2000-03-21 02:37:59 +00:00
Mikael Djurfeldt
7dbff8b15d (gc_sweep_freelist_finish): Inserted explanation of use of
gc_trigger.
2000-03-20 15:05:33 +00:00
Mikael Djurfeldt
37ddcaf606 * gc.c (scm_gc_stats): Inserted explanation of local_scm_mtrigger
etc.
(scm_gc_yield_1): New variable: Holds previous yield.  Used to
make better judgements.
2000-03-20 14:57:04 +00:00
Mikael Djurfeldt
7febb4a206 * print.h, stacks.h, options.c, options.h: Changed C++
commentaries to C.
2000-03-20 14:39:23 +00:00
Mikael Djurfeldt
bda1446cd5 * gc.c (adjust_gc_trigger): Improved documentation.
(alloc_some_heap): Since gc_trigger is used against
freelist->collected, this is the value which should be used to
predict minimum growth.
2000-03-20 13:39:33 +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
Mikael Djurfeldt
b37fe1c56e * gc.c (scm_gc_for_newcell, adjust_gc_trigger): Improved GC
trigger adjustmeant: Take yield (freed cells) for all freelists
into account.
(SCM_INIT_HEAP_SIZE_1, SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Tuned
to 50000 cell heap with 45% trigger.
(scm_gc_cells_collected): Reintroduced.
(SCM_HEAP_SIZE): New macro.
(scm_gc_sweep): Reintroduced correct computation of
scm_cells_allocated.
(scm_freelist_t): Corrected commentary for field `cluster_size':
Clustersize counts objects, not cells;  New member
`clusters_allocated'.
2000-03-19 20:05:02 +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
Dirk Herrmann
ba11fd4cb6 Only include root.h where it is actually needed. 2000-03-18 08:44:04 +00:00
Dirk Herrmann
7ab3fdd51f Only include strings.h where it is actually needed. 2000-03-17 18:11:58 +00:00
Dirk Herrmann
f04d8caf82 Only include ports.h where it is actually needed. 2000-03-17 16:10:13 +00:00
Dirk Herrmann
003d1fd046 Only include vectors.h in those files, where it is actually needed. 2000-03-17 15:23:03 +00:00
Dirk Herrmann
0fa27efa4a Removed empty file genio.h and references to it. 2000-03-17 13:37:33 +00:00
Mikael Djurfeldt
85dd66c830 (SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Default values set to -50. 2000-03-17 09:04:49 +00:00
Mikael Djurfeldt
1ba5ccd12b * 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.
(SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Default values set to -40.
2000-03-17 08:58:27 +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