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

327 commits

Author SHA1 Message Date
Michael Livshin
322ec19d3c * objects.h (SCM_SET_ENTITY_SETTER): new macro. SCM_ENTITY_SETTER
casts its result, so doesn't yield an lvalue per ANSI C.

* goops.c (s_scm_sys_set_object_setter_x): use
SCM_SET_ENTITY_SETTER.
(clear_method_cache): use SCM_SET_ENTITY_PROCEDURE.

* gc.h (SCM_GC_SET_CARD_BVEC): new macro.  SCM_GC_CARD_BVEC casts
its result, so doesn't yield an lvalue per ANSI C.
(SCM_GC_SET_CARD_FLAGS): ditto for SCM_GC_GET_CARD_FLAGS.
(SCM_GC_CLR_CARD_FLAGS): redefined in terms of
SCM_GC_SET_CARD_FLAGS.
(SCM_GC_SET_CARD_FLAG, SCM_GC_CLR_CARD_FLAGS): ditto.

* gc.c (INIT_CARD): use the explicit setter macro to set the bvec.
2001-01-11 21:03:18 +00:00
Dirk Herrmann
5d2b97cd07 * Fixed the changelog entry regarding re-introduction of struct member
properties (I continuously talked of member 'documentation' instead)
* Replace calls to scm_remember with calls to scm_remember_upto_here_1.
2000-12-28 16:49:09 +00:00
Michael Livshin
0209177b77 * gc.c: (scm_gc_mark_dependencies): use SCM_EQ_P for SCMs, not
'=='.  also, return after calling `scm_gc_mark'.
2000-12-24 09:54:24 +00:00
Michael Livshin
56495472c2 * gc.c: (scm_gc_mark_dependencies): new function. like
`scm_gc_mark', but doesn't mark the argument itself.  defined
using an arrangement similar to that in eval.c: `scm_gc_mark' and
`scm_gc_mark_dependencies' are derived from the same "template"
by ugly preprocessor magic.

* gc.h: added prototype for `scm_gc_mark_dependencies'.

* init.c (scm_init_guile_1): call the renamed
`scm_init_guardians'.

* guardians.h: changed prototypes for `scm_make_guardian' and
`scm_init_guardians'.

* guardians.c (guardian_t): added new fields `greedy_p' and
`listed_p'.
(GUARDIAN_P): predicate that says whether its argument is a
guardian.
(GUARDIAN_GREEDY_P, GUARDIAN_LISTED_P): new predicates.
(greedy_guardians, sharing_guardians): new variables.  hold the
greedy and sharing live guardian lists, respectively.
(first_live_guardian, current_link_field): removed.
(greedily_guarded_prop): new variable.  holds the "is greedily
guarded" object property.
(self_centered_zombies): new variable.  stores guarded objects
that are parts of cycles.
(add_to_live_list): new function, introduced to decouple marking a
guardian and adding it to the live list.
(guardian_mark): call `add_to_live_list'.
(guardian_print): print whether the guardian is greedy or not.
also change "live" and "zombie" to "reachable" and "unreachable"
respectively, to be less confusing.
(scm_guard): if the guardian is greedy, test whether the object is
already greedily marked.  throw an error if so.
(scm_get_one_zombie): if the guardian is greedy, remove the
"greedily guarded" property from the object.
(scm_make_guardian): add a new optional boolean argument which
says whether the guardian is greedy or sharing.
(guardian_gc_init): init the new live lists.
(mark_dependencies): new function.
(mark_and_zombify): new function.
(guardian_zombify): reworked to support the new guardian
semantics.  move some logic to `mark_dependencies' and
`mark_and_zombify'.
(whine_about_self_centered_zombies): new function.  installed in
the `after-gc-hook' to complain about guarded objects which are
parts of cycles.
(scm_init_guardians): init the new stuff.  renamed from
`scm_init_guardian'.
2000-12-23 23:00:23 +00:00
Dirk Herrmann
0f979f3fb6 * Renamed scm_symbols to symbols and made it static in symbols.c. 2000-12-13 11:38:30 +00:00
Dirk Herrmann
b52e071bc5 * The creation of symbols and bindings are two separate issues now. 2000-12-12 18:36:35 +00:00
Dirk Herrmann
85db4a2c8e * Initialize symbols using SCM_(GLOBAL_)?SYMBOL instead of scm_sysintern...
* Use scm_str2symbol instead of scm_sysintern0.
* Garbage collection initialization code now within gc.c only.
2000-12-11 14:48:23 +00:00
Dirk Herrmann
93d40df216 * Guile does not assume a hash table size of scm_symhash_dim any more. 2000-12-08 13:41:56 +00:00
Dirk Herrmann
23670993da * Undid my last patch and added a comment why it was unnecessary. 2000-12-07 13:46:33 +00:00
Dirk Herrmann
73369d6744 * Fixed: gc_async must be protected from gc. 2000-12-06 17:11:46 +00:00
Dirk Herrmann
78573619d0 * No binding is created for %gc-thunk any more. 2000-12-06 16:42:16 +00:00
Dirk Herrmann
362306b956 * Minor cleanup/optimization for char=?.
* Cleanup CCLO handling.
2000-12-04 17:19:35 +00:00
Gary Houston
5f144b105d * use an applicable SMOB to represent continuations, instead of a
custom tc7 type.  This will make it easier to support R5RS
	multiple value continuations, without the use of a Scheme-level
	wrapper.

	* continuations.c (scm_tc16_continuation, continuation_mark,
	continuation_free, continuation_print, continuation_apply):
	new SMOB support.
	(scm_make_continuation): new procedure, replaces scm_make_cont
	with a different interface.
	(copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten.
	(CHEAP_CONTINUATIONS): removed non-working code completely.
	(scm_call_continuation): removed.
	* continuations.h (struct scm_contregs): add num_stack_items and
	stack fields.  previously stack was stored following this struct:
	use a tail array instead.
	(SCM_CONTINUATIONP): new macro.
	(SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH):
	rewritten.
	(SCM_SET_CONTREGS): removed.
	* tags.h: removed scm_tc7_contin (was tag 61).
	* debug.c, gc.c, hash.c, print.c, procprop.c, procs.c:
	removed scm_tc7_contin support.
	* eval.c: use scm_make_continuation instead of scm_make_cont.
	don't set jump buffers here.  remove scm_tc7_contin support.
	* init.c, root.c: create SMOB continuation for rootcont instead
	of scm_tc7_contin.  call scm_init_continuations before
	scm_init_root.
	* root.c: remove support for static jmpbuf.  It's not used by
	default and I broke it.  create SMOB continuation for rootcont.
	* stacks.c: use SCM_CONTINUATIONP.
2000-11-25 16:58:25 +00:00
Dirk Herrmann
9377887701 * Deprecated SCM_SETLENGTH. 2000-11-23 08:59:22 +00:00
Marius Vollmer
8dc9439fc6 * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file.  Thanks
to Lars J. Aas!

* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions.  Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
Dirk Herrmann
b24b5e13bf * Get rid of calls to SCM_ROSTRINGP.
* Fix some string/symbol output problems with regards to substrings.
* Fix error output to prefer procedure name parameters over stack data.
* Use SCM_(SET_)?FILENAME where appropriate.
* Prefer calling scm_remember over scm_protect/unprotect_object calls.
2000-11-02 10:36:31 +00:00
Dirk Herrmann
1b9be268c8 * Deprecated scm_vector_set_length_x.
* Zero length vectors do not allocate dummy memory any more.
2000-10-25 12:58:51 +00:00
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
Dirk Herrmann
b5c2579a34 * Removed further calls to SCM_LENGTH. 2000-10-10 09:22:31 +00:00
Dirk Herrmann
405aaef932 * Eliminated all remaining calls to SCM_CHARS. 2000-09-26 21:53:49 +00:00
Dirk Herrmann
06ee04b27d * Further references to SCM_CHARS removed. 2000-09-26 20:34:26 +00:00
Dirk Herrmann
1660782ecf * Removed unused type tag scm_tc7_lvector. 2000-09-22 18:33:24 +00:00
Dirk Herrmann
f151f91293 * Eliminated some more calls to SCM_CHARS. 2000-09-22 17:43:57 +00:00
Dirk Herrmann
28b06554ca * Unified ssymbols and msymbols to a single symbol type 'scm_tc7_symbol'.
* Added scm_string_hash and deprecated scm_strhash.
2000-09-12 12:30:36 +00:00
Michael Livshin
3731149d83 * gc.c (scm_mark_locations): mark freecells too, and don't worry
about any possible false positives.
(scm_debug_newcell): don't change cell type to `allocated'.
(scm_debug_newcell2): ditto.
(scm_gc_for_newcell): ditto.
(scm_gc_mark): remove the tc16_allocated case.
2000-09-02 21:52:35 +00:00
Mikael Djurfeldt
641d17a83a * gc.c (scm_gc_mark): Don't use GUILE_DEBUG flag to compile in
extra tests.  (GUILE_DEBUG is only supposed to make extra
debugging functions available.)
2000-08-23 18:22:07 +00:00
Michael Livshin
7bb8eac780 * gc.c (scm_gc_sweep): added a `continue' statement that have
fallen through the cracks in the merge.  thanks to Shuji Narazaki!
2000-08-19 19:20:21 +00:00
Michael Livshin
d6884e6373 * gc.c: (scm_default_init_heap_size_*): defined to take cards into
account, but keeping more or less the same values as previously.
added some simple helper macros.
(CLUSTER_SIZE_IN_BYTES, ALIGNMENT_SLACK): defined to take cards
into account.
(BVEC_*, scm_mark_space_t, current_mark_space, mark_space_ptr,
current_mark_space_offset, mark_space_head, get_bvec,
clear_mark_space): new functions and supporting variables, types
and macros that implement mark space management.
(scm_igc): clear the mark space (all of it) before beginning the
mark phase.
(scm_gc_mark): changed the tests for rogue cells, much simplified
throughout (no different mark bit locations to worry about now).
(scm_mark_locations): don't consider card header cells.
(scm_cellp): ditto.
(scm_gc_sweep): simplified.
(init_heap_seg): changed to take cards into account.
2000-08-17 20:38:44 +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
Mikael Djurfeldt
7445e0e8eb * gc.c (scm_gc_mark, scm_gc_sweep): Remove vcell = 1 magic.
(scm_structs_to_free): New variable.
(scm_gc_sweep): Hook up structs to free on the scm_structs_to_free
chain.
2000-08-09 18:29:10 +00:00
Dirk Herrmann
1110299262 * Renamed local variable 'free' to avoid confusion with stdlib's 'free'. 2000-07-26 11:29:58 +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
c4da09e2dd * Minor cleanups in scm_mark_locations. 2000-07-13 07:40:04 +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
b6efc9510e * Keep track of the heap segment table size.
* Let the caller of alloc_some_heap determine the behaviour in case of
  malloc failures.  Use this feature in scm_gc_for_newcell.
2000-07-06 09:10:22 +00:00
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