Ludovic Courtes [Sun, 2 Jul 2006 20:26:29 +0000 (20:26 +0000)]
Implemented `gc-stats' using `libgc' information.
* libguile/gc.c (protected_obj_count): Made `static'.
(scm_heap_size): Mapped to `heap-size' rather than `cell-heap-size'.
(scm_heap_free_size): New.
(scm_heap_total_allocated): New.
(scm_gc_stats): Rewritten. Return the (little) information available
from `libgc'.
(scm_gc_disable): New.
(scm_gc_enable): New.
(scm_storage_prehistory): Don't call `GC_add_roots ()' with
SCM_SYS_PROTECTS. Use `GC_is_visible ()' to check whether
SCM_SYS_PROTECTS is visible.
* libguile/gc.h (scm_gc_enable): New declaration.
(scm_gc_disable): New declaration.
(scm_gc_for_alloc): Removed.
(scm_gc_for_newcell): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-46
Ludovic Courtes [Sun, 25 Jun 2006 22:44:00 +0000 (22:44 +0000)]
Have source properties only use regular GC mechanisms.
* libguile/srcprop.c: Include "libguile/gc.h".
(srcprops_chunklist): Removed.
(srcprops_freelist): Removed.
(srcprops_free): Removed.
(scm_make_srcprops): Use `scm_gc_malloc ()' rather than
SRCPROPS_FREELIST et al.
(scm_init_srcprop): Don't call `scm_set_smob_free ()'.
(scm_finish_srcprop): Do nothing.
* libguile/srcprop.h (SRCPROPS_CHUNKSIZE): Removed.
(scm_t_srcprops_chunk): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-45
Ludovic Courtes [Sun, 25 Jun 2006 22:43:47 +0000 (22:43 +0000)]
Fixed symbols so that interned symbols are only weakly referenced.
* libguile/symbols.c (lookup_interned_symbol): When a deleted weak pair
is encountered, remove it and update the hashtable's item count. Also,
check the hash table threshold and trigger a rehashing if needed.
(scm_i_c_mem2symbol): Allocate CELL using `scm_weak_car_pair ()' rather
than `scm_cons ()'.
(scm_i_mem2symbol): Likewise.
(scm_symbols_prehistory): Don't invoke `scm_permanent_object ()' for
SYMBOLS.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-44
Ludovic Courtes [Sun, 25 Jun 2006 22:43:33 +0000 (22:43 +0000)]
Re-fixed the hash table element counting in `scm_i_rehash ()'.
* libguile/hashtab.c (scm_i_rehash): Don't invoke
`SCM_HASHTABLE_DECREMENT ()' when a weak pair is encountered in the
source bucket.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-43
Ludovic Courtes [Sun, 25 Jun 2006 22:43:20 +0000 (22:43 +0000)]
Fixed `guardians.test' so that it does not use symbols.
* test-suite/tests/guardians.test: Use strings instead of symbols for
`g3-garbage' et al.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-42
Ludovic Courtes [Sun, 25 Jun 2006 22:43:05 +0000 (22:43 +0000)]
Allow guardians to be GC'd before the objects they guard.
* libguile/guardians.c (finalize_guarded): While traversing
GUARDIANS_LIST, check for deleted weak-car pairs.
(scm_i_guard): Instantiate GUARDIANS_FOR_OBJ using `scm_weak_car_pair ()'
rather than `scm_cons ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-41
Ludovic Courtes [Sun, 25 Jun 2006 22:42:34 +0000 (22:42 +0000)]
Minor weak hashtables fixes.
* libguile/hashtab.c (scm_fixup_weak_alist): Cosmetic change.
(scm_i_rehash): Call `SCM_HASHTABLE_DECREMENT ()' when a deleted weak
pair is encountered.
(scm_internal_hash_fold): Call `SCM_HASHTABLE_DECREMENT ()' instead of
a complicated `SCM_SET_HASHTABLE_N_ITEMS ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-40
Ludovic Courtes [Sun, 25 Jun 2006 22:42:19 +0000 (22:42 +0000)]
Moved weak pair code into `weaks.[ch]'.
* libguile/hashtab.c: Don't include <gc/gc_typed.h> and <gc/gc.h>.
Updated users of weak
(wcar_cell_descr): Removed.
(wcdr_cell_descr): Removed.
(scm_weak_car_cell): Removed.
(scm_weak_cdr_cell): Removed.
(scm_doubly_weak_cell): Removed.
(SCM_WEAK_CELL_*_DELETED_P): Removed.
(SCM_WEAK_CELL_WORD): Removed.
(SCM_WEAK_CELL_C[AD]R): Removed.
(scm_hashtab_prehistory): Don't initialize weak pairs.
* libguile/init.c (scm_i_init_guile): Invoke `scm_weaks_prehistory ()'
before `scm_hashtab_prehistory ()' in order to initialize weak pairs.
* libguile/weaks.c: Include <gc/gc.h> and <gc/gc_typed.h>.
(wc[ad]r_cell_descr): New.
(scm_weak_c[ad]r_pair): New.
(scm_doubly_weak_pair): New.
(scm_weaks_prehistory): New.
* libguile/weaks.h (scm_weak_c[ad]r_pair): New declaration.
(scm_doubly_weak_pair): New declaration.
(SCM_WEAK_PAIR_WORD_DELETED_P): New.
(SCM_WEAK_PAIR_CAR_DELETED_P): New.
(SCM_WEAK_PAIR_CDR_DELETED_P): New.
(SCM_WEAK_PAIR_DELETED_P): New.
(SCM_WEAK_PAIR_WORD): New.
(SCM_WEAK_PAIR_CAR): New.
(SCM_WEAK_PAIR_CDR): New.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-39
Ludovic Courtes [Tue, 13 Jun 2006 20:17:32 +0000 (20:17 +0000)]
Implemented rehashing of weak hash tables.
* libguile/hashtab.c (weak_hashtables): Removed.
(SCM_WEAK_CELL_DELETED_P): New macro.
(START_WEAK_BUCKET_FIXUP): Added the HASHFN argument. Invoke
`scm_i_rehash ()' when pairs have been removed.
(END_WEAK_BUCKET_FIXUP): Added the HASHFN argument.
(make_hash_table): Use `SCM_NEWSMOB2 ()' instead of `SCM_NEWSMOB3 ()'
-- last argument used to be WEAK_HASHTABLES.
(scm_i_rehash): Handle weak hash tables.
(to_rehash): Removed.
(scm_internal_hash_fold): Use `SCM_WEAK_CELL_DELETED_P ()' rather than
hand-written equivalent code.
(rehash_after_gc): Removed.
(scm_hashtab_prehistory): Don't add it as an after-gc hook.
* libguile/hashtab.h (SCM_HASHTABLE_NEXT): Removed.
(SCM_HASHTABLE_NEXTLOC): Removed.
(SCM_SET_HASHTABLE_NEXT): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-38
Ludovic Courtes [Sun, 11 Jun 2006 20:13:58 +0000 (20:13 +0000)]
Implemented port finalization.
* libguile/ports.c (register_finalizer_for_port): New.
(finalize_port): New.
(scm_new_port_table_entry): Call `register_finalizer_for_port ()'
before returning the new port.
(scm_ports_prehistory): Use `scm_gc_malloc_pointerless ()' instead of
`scm_gc_malloc ()' when allocating room for SCM_I_PORT_TABLE.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-37
Ludovic Courtes [Thu, 8 Jun 2006 22:01:47 +0000 (22:01 +0000)]
Use `scm_gc_malloc_pointerless' in various places (improves performance).
* libguile/fports.c (scm_fport_buffer_add): Use
`scm_gc_malloc_pointerless ()' instead of `scm_gc_malloc ()' when
allocating room for the read/write buffers.
* libguile/numbers.c (scm_c_make_rectangular): Likewise.
* libguile/ports.c (scm_ungetc): Likewise.
* libguile/random.c (scm_i_copy_rstate): Likewise.
(scm_c_make_rstate): Likewise.
* libguile/regex-posix.c (scm_make_regexp): Likewise.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-36
Ludovic Courtes [Tue, 30 May 2006 21:57:09 +0000 (21:57 +0000)]
Removed the now-useless `scm_struct_free_*' functions.
* libguile/struct.c (scm_alloc_struct): Set the `scm_struct_i_free'
element to 0 instead of `scm_struct_free_standard'.
(scm_struct_free_0): Removed.
(scm_struct_free_light): Removed.
(scm_struct_free_standard): Removed.
(scm_struct_free_entity): Removed.
* libguile/struct.h (scm_struct_free_0): Removed.
(scm_struct_free_light): Removed.
(scm_struct_free_standard): Removed.
(scm_struct_free_entity): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-35
Ludovic Courtes [Tue, 30 May 2006 21:56:55 +0000 (21:56 +0000)]
Removed unnecessary uses of class destructors.
* libguile/goops.c (scm_sys_inherit_magic_x): Don't invoke
`SCM_SET_CLASS_DESTRUCTOR' for legacy destructors that are no longer
needed (e.g., `scm_struct_free_entity ()', etc.).
* libguile/objects.c (scm_init_objects): Likewise.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-34
Ludovic Courtes [Tue, 30 May 2006 21:23:44 +0000 (21:23 +0000)]
Added support for the free function of structures.
* libguile/struct.c (struct_finalizer_trampoline): New.
(scm_struct_gc_init): Removed.
(scm_i_structs_to_free): Removed.
(scm_free_structs): Removed.
(scm_make_struct): Register a finalizer for the new struct if need be.
(scm_struct_prehistory): Cleared.
* libguile/struct.h (scm_i_structs_to_free): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-33
Ludovic Courtes [Tue, 30 May 2006 21:23:31 +0000 (21:23 +0000)]
Use the SMOB API in `coop-pthreads.c' rather than low-level primitives.
* libguile/coop-pthreads.c: Include "smob.h".
(make_thread): Use `SCM_NEWSMOB' rather than `scm_cell'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-32
Ludovic Courtes [Tue, 30 May 2006 21:23:18 +0000 (21:23 +0000)]
Fixed a warning in `symbols.c'.
* libguile/symbols.c (lookup_interned_symbol): When checking for `NULL',
use `SCM2PTR' rather than `SCM_UNPACK' (this fixes a warning).
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-31
Ludovic Courtes [Sun, 28 May 2006 20:05:05 +0000 (20:05 +0000)]
Fixed the SMOB mark procedure so that it handles free-list objects.
* libguile/smob.c (smob_mark): Check the 7-bit type tag and ignore those
whose type tag is not that of a SMOB in order to cleanly handle
free-list objects (this fixes a bug which showed up on SPARC64).
Also, don't mark & push ADDR itself.
(scm_gc_mark): Moved the definition and undefinition of
`CURRENT_MARK_PTR' and `CURRENT_MARK_LIMIT' here.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-30
Ludovic Courtes [Fri, 26 May 2006 13:50:21 +0000 (13:50 +0000)]
Fixed use of finalizers for guardians and SMOBs (undoes patches 23-24).
* libguile/gc.c (finalizer_trampoline): Removed.
(scm_gc_register_finalizer): Removed (undoes patches 23 and 24).
* libguile/gc.h (scm_gc_register_finalizer): Removed.
* libguile/guardians.c (finalize_guarded): Undid patch 23. Added support
for "proxied finalizers".
(scm_i_guard): Likewise.
* libguile/smob.c (scm_i_finalize_smob): Adapted to
`GC_finalization_proc'.
* libguile/smob.h: Include <gc/gc.h>.
(SCM_NEWSMOB): Use `GC_REGISTER_FINALIZER_NO_ORDER' instead of
`scm_gc_register_finalizer ()'.
(SCM_NEWSMOB3): Likewise.
(scm_i_finalize_smob): Updated.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-29
Ludovic Courtes [Tue, 23 May 2006 22:00:11 +0000 (22:00 +0000)]
Removed a lot of now-useless SMOB mark/free functions.
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'.
* libguile/async.c (async_gc_mark): Removed.
(scm_init_async): Don't invoke `scm_set_smob_mark'.
* libguile/coop-pthreads.c (thread_mark): Removed.
(create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when
allocating `launch_data'.
(mutex_mark): Removed.
(scm_threads_init): Don't invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'.
* libguile/dynl.c (dynl_obj_mark): Removed.
(scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'.
* libguile/dynwind.c (winder_mark): Removed.
(scm_init_dynwind): Don't invoke `scm_set_smob_mark'.
* libguile/environments.c (environment_mark): Removed.
(environment_free): Removed.
(observer_mark): Removed.
(core_environments_mark): Removed.
(core_environments_finalize): Removed.
(leaf_environment_mark): Removed.
(leaf_environment_free): Removed.
(leaf_environment_funcs): Don't refer to the above funcs.
(eval_environment_mark): Removed.
(eval_environment_free): Removed.
(eval_environment_funcs): Don't refer to the above funcs.
(import_environment_mark): Removed.
(import_environment_free): Removed.
(import_environment_funcs): Don't refer to the above funcs.
(export_environment_mark): Removed.
(export_environment_free): Removed.
(export_environment_funcs): Don't refer to the above funcs.
(scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/environments.h (scm_environment_funcs)[mark]: Removed.
[free]: Removed.
* libguile/eval.c (promise_mark): Removed.
(promise_free): Removed.
(scm_init_eval): Don't invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/fluids.c (fluid_free): Removed.
(scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/futures.c (future_mark): Removed.
(scm_init_futures): Don't invoke `scm_set_smob_mark'.
* libguile/hashtab.c (hashtable_free): Removed.
(scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'.
* libguile/keywords.c (scm_init_keywords): Don't invoke
`scm_set_smob_mark'.
* libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'.
* libguile/modules.c (scm_init_modules): Don't invoke
`scm_set_smob_mark'.
* libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'.
* libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of
`scm_malloc'.
(scm_c_make_rstate): Likewise.
(rstate_free): Removed.
(scm_init_random): Don't invoke `scm_set_smob_free'.
* libguile/srcprop.c (srcprops_mark): Removed.
(scm_init_srcprop): Don't invoke `srcprops_mark'.
* libguile/srfi-14.c (charset_free): Removed.
(scm_init_srfi_14): Don't invoke `scm_set_smob_free'.
* libguile/srfi-4.c (uvec_mark): Removed.
(uvec_free): Removed.
(scm_init_srfi_4): Don't invoke `scm_set_smob_free' and
`scm_set_smob_mark'.
* libguile/threads.c (thread_mark): Removed.
(fat_mutex_mark): Removed.
(fat_cond_mark): Removed.
(scm_init_threads): Dont invoke `scm_set_smob_mark' and
`scm_set_smob_free'.
* libguile/unif.c (bitvector_free): Removed.
(array_mark): Removed.
(array_free): Removed.
(scm_init_unif): Don't invoke `scm_set_smob_free' and
`scm_set_smob_mark'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
Ludovic Courtes [Tue, 23 May 2006 21:59:56 +0000 (21:59 +0000)]
Fixed the undocumented `scm_make_smob ()' function.
* libguile/smob.c (scm_make_smob): Use `SCM_RETURN_NEWSMOB ()' instead of
`scm_cell ()' when instantiating the SMOB.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-27
Ludovic Courtes [Tue, 23 May 2006 21:59:42 +0000 (21:59 +0000)]
Added support for SMOBs free function (via finalizers).
* libguile/smob.c (scm_i_finalize_smob): New.
* libguile/smob.h (SCM_NEWSMOB): Register `scm_i_finalize_smob ()' as a
finalizer for Z if its SMOB type has a free function.
(SCM_NEWSMOB3): Likewise.
(scm_i_finalize_smob): New declaration.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-26
Ludovic Courtes [Tue, 23 May 2006 21:59:28 +0000 (21:59 +0000)]
Removed the free function from the malloc-object SMOB type.
* libguile/mallocs.c (malloc_free): Removed.
(scm_init_mallocs): Don't invoke `scm_set_smob_free ()' because the
memory allocated by `scm_gc_malloc ()' will automatically be freed.
Furthermore, `malloc_free ()' used to invoke `free ()' instead of
`scm_gc_free ()' which is incorrect.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-25
Ludovic Courtes [Tue, 23 May 2006 21:59:14 +0000 (21:59 +0000)]
Fixed `scm_gc_register_finalizer ()' to avoid bootstrap problem.
* libguile/gc.c (finalizer_trampoline): Don't use `scm_call_2 ()' to
invoke the finalizer: directly call the C function instead.
(scm_gc_register_finalizer): Don't create a real subr with
`scm_c_make_gsubr ()': simply convert the C function pointer to an
`SCM' object instead.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-24
Ludovic Courtes [Tue, 23 May 2006 21:59:00 +0000 (21:59 +0000)]
Generalized BGC's finalizer mechanism. Use it in `guardians.c'.
* libguile/gc.c (finalizer_trampoline): New.
(scm_gc_register_finalizer): New.
* libguile/gc.h (scm_gc_register_finalizer): New declaration.
* libguile/guardians.c (finalize_guarded): Updated to the new prototype.
(scm_i_guard): Use `scm_gc_register_finalizer ()' instead of
`GC_REGISTER_FINALIZER_NO_ORDER ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-23
Ludovic Courtes [Mon, 22 May 2006 19:12:12 +0000 (19:12 +0000)]
Added support for SMOB custom mark procedures.
* libguile/gc.c (scm_gc_mark): Removed.
(scm_gc_mark_dependencies): Removed.
(scm_mark_locations): Removed.
* libguile/gc.h (scm_gc_mark_dependencies): Removed.
(scm_mark_locations): Removed.
* libguile/inline.h (scm_cell): Use `GC_MALLOC ()' instead of `GC_malloc ()'.
* libguile/smob.c (smob_freelist): New.
(smob_gc_kind): New.
(smob_mark): New.
(scm_gc_mark): New.
(scm_i_new_smob_with_mark_proc): New.
(scm_smob_prehistory): Initialize `smob_freelist' and `smob_gc_kind'.
* libguile/smob.h (scm_i_new_smob_with_mark_proc): New declaration.
(SCM_NEWSMOB): Use it if a mark procedure is available.
(SCM_NEWSMOB2): Likewise.
(SCM_NEWSMOB3): Likewise.
* libguile/threads.c (guilify_self_1): Initialize the
`current_mark_stack_*' fields.
* libguile/threads.h (scm_i_thread)[current_mark_stack_ptr]: New field.
[current_mark_stack_limit]: New field.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-22
Ludovic Courtes [Thu, 18 May 2006 08:08:47 +0000 (08:08 +0000)]
Removed the mark/free functions of continuations and threads.
* libguile/continuations.c (continuation_mark): Removed.
(continuation_free): Removed.
(scm_init_continuations): Don't use them.
* libguile/coop-pthreads.c (scm_threads_mark_stacks): Removed (was
unused).
* libguile/threads.c (scm_threads_mark_stacks): Likewise.
* libguile/threads.h (scm_threads_mark_stacks): Likewise.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-21
Ludovic Courtes [Thu, 18 May 2006 08:08:32 +0000 (08:08 +0000)]
Removed useless files; beautified `libguile/Makefile.am'.
* libguile/Makefile.am: Beautified backslashification (complements `patch-1').
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-20
Ludovic Courtes [Thu, 18 May 2006 08:08:13 +0000 (08:08 +0000)]
Disabled the `environments' unit test.
* test-suite/Makefile.am (SCM_TESTS): Removed `tests/environments.test'.
* test-suite/tests/environments.nottest: Disabled.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-19
Ludovic Courtes [Sun, 14 May 2006 18:44:09 +0000 (18:44 +0000)]
procs/weaks/hashtab: Removed a bit of useless mark/free code.
* libguile/hashtab.c (UNMARKED_CELL_P): Removed.
(scm_i_scan_weak_hashtables): Removed.
* libguile/hashtab.h (scm_i_scan_weak_hashtables): Removed.
* libguile/procs.c (scm_mark_subr_table): Removed.
* libguile/procs.h (scm_mark_subr_table): Removed.
* libguile/weaks.c (UNMARKED_CELL_P): Removed.
(scm_i_remove_weaks): Removed.
(scm_i_remove_weaks_from_weak_vectors): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-18
Ludovic Courtes [Sun, 14 May 2006 18:43:42 +0000 (18:43 +0000)]
Tiny updates in `environments.c'.
* libguile/environments.c (scm_make_environment): Use
`SCM_RETURN_NEWSMOB' instead of `scm_cell'.
(core_environments_observe): Use `SCM_NEWSMOB3' instead of
`scm_double_cell'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-17
Ludovic Courtes [Tue, 9 May 2006 22:11:09 +0000 (22:11 +0000)]
Fixes in weak hash tables handling, notably in `hash-fold'.
* libguile/hashtab.c (scm_i_rehash): Return immediately if TABLE is weak.
(scm_hash_fn_create_handle_x): Explicitly mention that we don't support
weak alist vectors.
(scm_internal_hash_fold): Handle weak pairs within buckets.
* libguile/modules.c (scm_module_reverse_lookup): Handle weak alists
(currently, don't do anything if a NULL pair is met).
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-16
Ludovic Courtes [Tue, 2 May 2006 21:35:52 +0000 (21:35 +0000)]
Fixed a typo/bug in `make-doubly-weak-alist-vector'.
* libguile/weaks.c (scm_make_doubly_weak_alist_vector): Fixed typo
(endless recursive call).
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-15
Ludovic Courtes [Tue, 2 May 2006 21:30:58 +0000 (21:30 +0000)]
Fixed printing of weak vectors.
* libguile/print.c (iprin1): When displaying a weak vector, access
elements via `scm_c_vector_ref ()', not via the macro.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-14
Ludovic Courtes [Tue, 2 May 2006 21:30:37 +0000 (21:30 +0000)]
Fixed `list->weak-vector'.
* libguile/vectors.c (scm_i_allocate_weak_vector): Removed.
(MAKE_WEAK_VECTOR): New macro.
(allocate_weak_vector): New.
(scm_i_make_weak_vector): New.
(scm_i_make_weak_vector_from_list): New.
* libguile/vectors.h: Updated.
* libguile/weaks.c (scm_make_weak_vector): Use `scm_i_make_weak_vector ()'.
(scm_weak_vector): Use `scm_i_make_weak_vector_from_list ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-13
Ludovic Courtes [Tue, 2 May 2006 21:30:07 +0000 (21:30 +0000)]
Fixed weak alist vectors by having them use weak hash tables instead.
* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
`scm_make_weak_key_hash_table ()'.
(scm_make_weak_value_alist_vector): Use `scm_make_weak_value_hash_table ()'.
(scm_make_doubly_weak_alist_vector): Use `scm_make_doubly_weak_hash_table ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-12
Ludovic Courtes [Tue, 25 Apr 2006 16:23:31 +0000 (16:23 +0000)]
First stab at the guardian implementation. Works fine at first glance!
* libguile/guardians.c: Overhauled. Removed the `tconc' structure.
Much, much, simpler.
(finalize_guarded): New function.
* libguile/init.c (scm_i_init_guile): Call `scm_init_guardians ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-11
Ludovic Court`es [Thu, 20 Apr 2006 13:07:47 +0000 (13:07 +0000)]
Tell `libgc' that we're using POSIX threads. This fixes Guile on PPC.
* libguile/coop-defs.h: If `GUILE_PTHREAD_COMPAT' is defined, then define
`GC_THREADS' and include <gc/gc.h> after <pthread.h>.
* libguile/coop-pthreads.h: Likewise.
* libguile/pthread-threads.h: Likewise.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-10
Ludovic Courtes [Sun, 9 Apr 2006 16:13:22 +0000 (16:13 +0000)]
Fixed `scm_fixup_weak_alist ()'; update weak hash table size as needed.
* libguile/hashtab.c (scm_fixup_weak_alist): Added a REMOVED_ITEMS
parameter. Fixed a bug in the case where PREV is `SCM_EOL'.
(IS_WEAK_THING): New macro.
(START_WEAK_BUCKET_FIXUP): New macro.
(END_WEAK_BUCKET_FIXUP): New macro.
(scm_hash_fn_get_handle)[buckets]: New variable. Use the above
macros.
(scm_hash_fn_create_handle_x): Likewise.
(scm_hash_fn_remove_x): Likewise.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-9
Ludovic Courtes [Sun, 9 Apr 2006 16:13:01 +0000 (16:13 +0000)]
Fixed the weak cell implementation (for weak hash tables).
* libguile/hashtab.c (wcar_cell_descr): New.
(wcdr_cell_descr): New.
(scm_weak_car_cell): Use `GC_malloc_explicitly_typed ()' instead of
`scm_gc_malloc_pointerless ()'.
(scm_weak_cdr_cell): Likewise.
(SCM_WEAK_CELL_WORD_DELETED_P): Use `SCM_CELL_OBJECT' instead of
`SCM_CELL_WORD'.
(scm_hash_fn_get_handle): Call `GC_disable ()' before calling
`scm_fixup_weak_alist ()' and `GC_enable ()' afterwards.
(scm_hash_fn_create_handle_x): Likewise.
(scm_hash_fn_remove_x): Likewise.
(scm_hashtab_prehistory): Initialize WCAR_CELL_DESCR and
WCDR_CELL_DESCR.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-8
Ludovic Courtes [Tue, 4 Apr 2006 21:28:13 +0000 (21:28 +0000)]
First stab at implementing weak hash tables and vectors. Unable to run the REPL.
* libguile/hashtab.c (scm_weak_car_cell): New.
(scm_weak_cdr_cell): New.
(scm_doubly_weak_cell): New.
(SCM_WEAK_CELL_WORD_DELETED_P): New.
(SCM_WEAK_CELL_WORD): New.
(scm_fixup_weak_alist): New.
(make_hash_table): Always use non-weak vectors. Allocate
`scm_t_hashtable' objects as pointerless.
(scm_i_rehash): Always make NEW_BUCKETS a non-weak vector.
(scm_hash_fn_get_handle): Call `scm_fixup_weak_alist ()' on weak
buckets before calling ASSOC_FN.
(scm_hash_fn_remove_x): Likewise.
(scm_hash_fn_create_handle_x): Likewise. Also, use `scm_.*weak.*cell
()' for HANDLE when needed.
* libguile/symbols.c (lookup_interned_symbol): Check for nullified
pairs.
* libguile/vectors.c (scm_vector_elements): Abort on weak vectors.
(scm_vector_writable_elements): Likewise.
(scm_c_vector_ref): Check whether the referenced element has been
nullified.
(scm_c_vector_set_x): Use `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.
(scm_i_allocate_weak_vector): Use `scm_gc_malloc_pointerless ()'
instead of `scm_gc_malloc ()' when allocating room for the vector
itself.
* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
`scm_make_vector ()' instead of `scm_i_allocate_weak_vector ()'.
(scm_make_weak_value_alist_vector): Likewise.
(scm_make_doubly_weak_alist_vector): Likewise.
(weak_vectors): Removed.
(scm_i_init_weak_vectors_for_gc): Removed.
(scm_i_mark_weak_vector): Removed.
(scm_i_mark_weak_vector_non_weaks): Removed.
(scm_i_mark_weak_vectors_non_weaks): Removed.
(scm_i_remove_weaks_from_weak_vectors): Commented out.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-7
Ludovic Courtes [Tue, 4 Apr 2006 21:27:48 +0000 (21:27 +0000)]
Fixed GC initialization and static roots.
* libguile/gc.c (scm_storage_prehistory): Call `GC_INIT ()'. Invoke
`GC_add_roots ()' as well.
(scm_init_gc): Removed call to `GC_init ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-6
Ludovic Courtes [Tue, 4 Apr 2006 21:27:23 +0000 (21:27 +0000)]
Added `scm_gc_malloc_pointerless ()', equivalent to `GC_MALLOC_ATOMIC ()'.
* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Tidied.
(scm_gc_unregister_collectable_memory): Likewise.
(scm_gc_malloc_pointerless): New.
* libguile/gc.h (scm_gc_malloc_pointer_less): New declaration.
* libguile/strings.c (make_stringbuf): Use it.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-5
Ludovic Courtes [Sun, 2 Apr 2006 21:05:34 +0000 (21:05 +0000)]
Fixed garbage collection of ports: basics work (no SMOBs, no guardians, no WHT).
* libguile/gc.c (scm_init_storage): Do not initialize SCM_I_PORT_TABLE
here: this is done in `scm_ports_prehistory ()'. This fixes the bug
mentioned in the previous patch log.
* libguile/ports.c (scm_new_port_table_entry): Slightly clarified the
code.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-4
Ludovic Courtes [Sun, 2 Apr 2006 21:05:04 +0000 (21:05 +0000)]
First ``working'' Guile! Crashes in `flush-all-ports' (relates to SCM_I_PORT_TABLE).
* libguile/gc.c (scm_gc_stats): Fixed so that it returns a relevant
result instead of just `SCM_EOL'.
* libguile/ports.c: Include `assert.h'. Don't include `malloc.h'.
(scm_make_port_type): Use `scm_gc_realloc ()' instead of `realloc ()'.
(scm_new_port_table_entry): Likewise.
(scm_flush): Added an assertion on the port number.
(scm_ports_prehistory): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-3
Ludovic Courtes [Sun, 2 Apr 2006 21:04:30 +0000 (21:04 +0000)]
Small fixes. Gets to the REPL and `abort ()'s soon after.
* libguile/inline.h (scm_cell): Re-added comment about the assignment
order of CAR/CDR.
* libguile/srcprop.c (scm_make_srcprops): Use `scm_gc_malloc ()' instead
of `malloc' + `scm_gc_register_collectable_memory ()'.
* libguile/threads.c (guilify_self_1): Likewise.
(guilify_self_2): Likewise.
* libguile/strings.c (make_stringbuf): Use `GC_MALLOC_ATOMIC ()' instead
of `scm_gc_malloc ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-2
Ludovic Courtes [Tue, 21 Mar 2006 22:16:33 +0000 (22:16 +0000)]
Merge from lcourtes@laas.fr--2005-mobile
Patches applied:
* lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9 (base, patch 1)
- tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0
- Initial hack for Boehm's GC support: nothing works.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1
Neil Jerram [Wed, 27 Sep 2006 17:49:38 +0000 (17:49 +0000)]
(Slot Options): Added example from Ludovic Courtès
about difference between init-value, -form and -thunk.
Neil Jerram [Tue, 26 Sep 2006 21:43:52 +0000 (21:43 +0000)]
(Using Guile in Emacs, GDS Introduction):
Editorial updates.
(GDS Architecture): Moved earlier in containing section; editorial
updates.
(GDS Getting Started, How to Use GDS): Merged; editorial updates;
subsections reordered.
Neil Jerram [Mon, 25 Sep 2006 21:05:46 +0000 (21:05 +0000)]
* scheme-using.texi (Error Handling, Interactive Debugger): Minor
editorial improvements.
(Leave Debugger): Removed.
(Display Backtrace): Minor updates.
(Frame Selection, Frame Information, Frame Evaluation) : Minor
editorial improvements.
(Stepping and Continuing): Merged from three previous nodes; plus
minor improvements. Removed doc for `trace-finish', which no
longer exists.
* debugging/ice-9-debugger-extensions.scm (debugger:step):
Docstring improvements.
(debugger:next): Docstring improvements.
(debugger:continue): Docstring improvements.
* debugger/commands.scm (up, down): Docstring corrections.
(info-args, info-frame, position, evaluate): Docstring
improvements.
Neil Jerram [Mon, 25 Sep 2006 20:37:23 +0000 (20:37 +0000)]
Fix typo.
Ludovic Courtès [Wed, 20 Sep 2006 13:13:34 +0000 (13:13 +0000)]
Changes from arch/CVS synchronization
Ludovic Courtès [Wed, 20 Sep 2006 12:48:45 +0000 (12:48 +0000)]
Changes from arch/CVS synchronization
Rob Browning [Wed, 20 Sep 2006 00:34:02 +0000 (00:34 +0000)]
*** empty log message ***
Rob Browning [Wed, 20 Sep 2006 00:33:56 +0000 (00:33 +0000)]
(build-link): Restore the removal of "/usr/lib" (in addition to
"/usr/lib/" from any -L arguments).
Neil Jerram [Fri, 15 Sep 2006 09:23:18 +0000 (09:23 +0000)]
Doc typo fixes
Rob Browning [Fri, 1 Sep 2006 01:38:18 +0000 (01:38 +0000)]
*** empty log message ***
Rob Browning [Fri, 1 Sep 2006 01:37:57 +0000 (01:37 +0000)]
(scm_c_port_for_each): Add a scm_remember_upto_here_1(ports) at the
end of the function to fix a GC bug.
Neil Jerram [Tue, 29 Aug 2006 22:47:41 +0000 (22:47 +0000)]
(Debug on Error): Added paragraph on need to use
debugging evaluator. Added text on what the Guile REPL code does.
Neil Jerram [Mon, 28 Aug 2006 22:17:26 +0000 (22:17 +0000)]
(scm_display_backtrace_with_highlights): Minor
improvements to docstring.
(scm_backtrace_with_highlights): Analogous improvements.
Neil Jerram [Mon, 28 Aug 2006 22:16:42 +0000 (22:16 +0000)]
(Examining the Stack): Minor improvements to
display-backtrace doc.
(Debug on Error): More new text on catching the error stack.
Neil Jerram [Sun, 27 Aug 2006 14:06:16 +0000 (14:06 +0000)]
(Debug on Error): New text on how to catch errors
and the error stack.
Neil Jerram [Wed, 23 Aug 2006 22:11:24 +0000 (22:11 +0000)]
(Using Guile in Emacs): New text about
available Emacs libraries.
(GDS Introduction): New node, containing GDS-specific introductory
text.
Neil Jerram [Fri, 18 Aug 2006 14:21:23 +0000 (14:21 +0000)]
* gds-server.el (gds-start-server): Change "ossau" to "ice-9".
* gds-scheme.el (gds-start-utility-guile): Change "ossau" to
"ice-9".
Neil Jerram [Fri, 18 Aug 2006 14:19:44 +0000 (14:19 +0000)]
* configure.in: Generate Makefile for emacs subdir.
* Makefile.am (SUBDIRS): Add emacs subdir.
* configure.in: Generate Makefile for ice-9/debugging subdir.
Neil Jerram [Fri, 18 Aug 2006 13:43:09 +0000 (13:43 +0000)]
.cvsignore file
Neil Jerram [Fri, 18 Aug 2006 13:41:45 +0000 (13:41 +0000)]
* configure.in: Generate Makefile for ice-9/debugging.
* debugging/trc.scm: New file.
* debugging/traps.scm: New file.
* debugging/trace.scm: New file.
* debugging/steps.scm: New file.
* debugging/load-hooks.scm: New file.
* debugging/ice-9-debugger-extensions.scm: New file.
* debugging/example-fns.scm: New file.
* debugging/breakpoints.scm: New file.
* debugging/Makefile.am: New.
* Makefile.am (SUBDIRS): Add debugging.
Neil Jerram [Fri, 18 Aug 2006 13:14:46 +0000 (13:14 +0000)]
(Using Guile in Emacs): Unignore extra GDS
intro text. (I will edit this down later. For now it's
convenient to have it all appearing, so it's visible on paper.)
Neil Jerram [Fri, 11 Aug 2006 16:21:14 +0000 (16:21 +0000)]
* scheme-using.texi (Run To Frame Exit): Improved doc for finish.
(Continue Execution): Improved doc for continue.
(Using Guile in Emacs): Lots of new docs about the Emacs
interface.
* api-debug.texi (Low Level Trap Calls): New.
(Using Traps): Removed, material incorporated into Low Level Trap
Calls.
(High Level Traps): New.
(Breakpoints): New.
* scheme-using.texi (Single Stepping): Improve doc for step and
next.
* api-debug.texi (Debug on Error): Note need to handling of errors
in C.
Neil Jerram [Fri, 11 Aug 2006 15:38:19 +0000 (15:38 +0000)]
(Debugging): New intro text. New subsection
"Evaluation Model". Moved existing subsections "Capturing the
Stack or Innermost Stack Frame", "Examining the Stack", "Examining
Stack Frames", "Source Properties", "Decoding Memoized Source
Expressions" and "Starting a New Stack" under "Evaluation Model".
(Capturing the Stack or Innermost Stack Frame): Some new text, and
correction to doc for last-stack-frame.
(Debug on Error): Renamed from "Interactive Debugging".
Neil Jerram [Fri, 11 Aug 2006 15:33:41 +0000 (15:33 +0000)]
(scm_last_stack_frame): Correct docstring (returns a
frame, not a stack).
Neil Jerram [Tue, 1 Aug 2006 21:51:12 +0000 (21:51 +0000)]
* api-debug.texi (Breakpoints): Removed (all wrong).
* guile.texi (API Reference): Improved summary for "Debugging"
menu item.
Neil Jerram [Tue, 1 Aug 2006 21:33:17 +0000 (21:33 +0000)]
* scheme-debugging.texi (Debug Last Error, Interactive Debugger):
Moved/merged to scheme-using.texi, as REPL features.
(Examples): New.
(Intro to Breakpoints): New introductory text here. Removed all
subnodes except for Breakpoints Overview.
* scheme-using.texi: New.
* guile.texi (Programming in Scheme): Include new
scheme-using.texi file.
* Makefile.am (guile_TEXINFOS): Include new scheme-using.texi
file.
Rob Browning [Wed, 19 Jul 2006 06:56:37 +0000 (06:56 +0000)]
*** empty log message ***
Rob Browning [Wed, 19 Jul 2006 06:56:30 +0000 (06:56 +0000)]
Add __attribute__ ((returns_twice)) to the ia64_getcontext prototype
so that gcc will make the right arrangements and avoid an illegal
instruction during call-with-current-continuation.
Ludovic Courtès [Wed, 12 Jul 2006 08:07:27 +0000 (08:07 +0000)]
Changes from arch/CVS synchronization
Neil Jerram [Mon, 19 Jun 2006 22:37:13 +0000 (22:37 +0000)]
* Makefile.am (ice9_sources): Add new files.
* gds-client.scm, gds-server.scm: New files.
Neil Jerram [Mon, 19 Jun 2006 22:01:23 +0000 (22:01 +0000)]
* Makefile.am: New file.
* gds.el, gds-scheme.el, gds-server.el: New files.
Kevin Ryde [Sat, 17 Jun 2006 23:41:24 +0000 (23:41 +0000)]
merge from 1.8 branch
Kevin Ryde [Sat, 17 Jun 2006 23:29:46 +0000 (23:29 +0000)]
merge from 1.8 branch
Kevin Ryde [Sat, 17 Jun 2006 23:15:59 +0000 (23:15 +0000)]
merge from 1.8 branch
Kevin Ryde [Sat, 17 Jun 2006 22:57:28 +0000 (22:57 +0000)]
merge from 1.8 branch
And: show "1.8" not "1.10" in effective version, that being what it
was at the time of that news entry
Kevin Ryde [Sat, 17 Jun 2006 22:53:04 +0000 (22:53 +0000)]
merge from 1.8 branch
Kevin Ryde [Sat, 17 Jun 2006 22:47:50 +0000 (22:47 +0000)]
merge 1.8 branch
Ludovic Courtès [Fri, 16 Jun 2006 07:39:59 +0000 (07:39 +0000)]
Changes from arch/CVS synchronization
Ludovic Courtès [Tue, 13 Jun 2006 08:14:01 +0000 (08:14 +0000)]
Changes from arch/CVS synchronization
Ludovic Courtès [Tue, 13 Jun 2006 07:56:41 +0000 (07:56 +0000)]
Added `structs.test'.
Ludovic Courtès [Tue, 13 Jun 2006 07:48:42 +0000 (07:48 +0000)]
Changes from arch/CVS synchronization
Neil Jerram [Tue, 6 Jun 2006 21:39:43 +0000 (21:39 +0000)]
(ACX_PTHREAD): Update to latest definition from
autoconf macro archive, to fix pthread linking problem on Solaris
10, reported by Charles Gagnon.
Marius Vollmer [Mon, 29 May 2006 21:54:13 +0000 (21:54 +0000)]
* eq.c (scm_equal_p): Use scm_array_equal_p explicitely when one
of the arguments is a array. This allows vectors to be equal to
one-dimensional arrays.
* tests/unif.test ("vector equal? one-dimensional array"): New.
Marius Vollmer [Mon, 29 May 2006 20:35:48 +0000 (20:35 +0000)]
(scm_ithrow): When looking for the jmpbuf, first test that we have a
pair before accessing its cdr. Thanks to Bill Schottstaedt!
Marius Vollmer [Sat, 27 May 2006 22:24:24 +0000 (22:24 +0000)]
Delete test file after all tests have run in order to make "make
distcheck" work.
Marius Vollmer [Sat, 27 May 2006 21:32:22 +0000 (21:32 +0000)]
Replace SCM_C_INLINE with SCM_C_INLINE_KEYWORD. Thanks to Mark Gran!
Marius Vollmer [Sat, 27 May 2006 21:31:32 +0000 (21:31 +0000)]
*** empty log message ***
Marius Vollmer [Sat, 27 May 2006 21:05:07 +0000 (21:05 +0000)]
*** empty log message ***
Marius Vollmer [Sun, 7 May 2006 22:51:06 +0000 (22:51 +0000)]
(CELL_P): Also check that the potential pointer is
correctly aligned for a cell. Thanks to Miroslav Lichvar!
Marius Vollmer [Mon, 1 May 2006 21:32:21 +0000 (21:32 +0000)]
(SCM_BENCHMARKS_DIRS, dist-hook): Removed, they are
no longer needed and lead to unclean tarballs.
Marius Vollmer [Mon, 1 May 2006 21:07:20 +0000 (21:07 +0000)]
Changed "1.7" to "1.10" in description of the effective version.
Thanks to Jon Wilson!
Kevin Ryde [Mon, 17 Apr 2006 01:48:50 +0000 (01:48 +0000)]
*** empty log message ***
Kevin Ryde [Mon, 17 Apr 2006 01:48:14 +0000 (01:48 +0000)]
(lstat): Allow for test-symlink not existing yet.
Kevin Ryde [Mon, 17 Apr 2006 01:36:55 +0000 (01:36 +0000)]
*** empty log message ***