summaryrefslogtreecommitdiff
path: root/libguile/vectors.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-27Rename scm_t_array_handle.array to .rootDaniel Llorens1-1/+1
Globally rename this field (after shared-array-root), since it's not an array.
2014-01-27Bounds error in vector_handle_ref/set is implementation errorDaniel Llorens1-5/+3
* libguile/vectors.c: bounds are already checked unless impl is called directly, so don't check again. * libguile/strings.c, libguile/bitvectors.c: fix comments.
2014-01-27Have array impl->vref, vset take SCM, not handlesDaniel Llorens1-6/+6
* libguile/array-handle.h - scm_i_t_array_ref, scm_i_t_array_set take SCM. - scm_array_handle_ref, scm_array_handle_set: pass h->array. * libguile/array-map.c - AREF, ASET, rafill, racp, ramap, rafe: pass storage vector SCM instead of handle. * libguile/bitvector.c - bitvector_handle_ref, bitvector_handle_set_x: take bitvector arg. * libguile/bytevectors.c - bv_handle_ref, bv_handle_set_x: take bytevector arg. - scm_i_print_bytevectors: don't use array handles. * libguile/deprecated.c - scm_generalized_vector_to_list: pass h.array. * libguile/strings.c - string_handle_ref, string_handle_set: take string arg. * libguile/uniform.c - scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x: pass h.array. * libguile/vectors.c - vector_handle_ref, vector_handle_set: take vector arg.
2014-01-27Avoid using array_handle fields in impl->vref/vsetDaniel Llorens1-4/+4
* libguile/bytevectors.c: (bv_handle_set_x, bv_handle_ref): get length and element type fields from the bytevector, not from the handle. * libguile/vectors.c: (vector_handle_set, vector_handle_ref): get length from the vector, not from the handle.
2014-01-27Use underlying vector implementation directly in array handlesDaniel Llorens1-2/+3
* libguile/array-handle.c - scm_array_get_handle: if the object is an array, point impl to the underlying vector instead of array impl, then fix the axes. Avoid calling scm_i_array_implementation_for_obj twice. * libguile/arrays.c - array_handle_ref, array_handle_set, array_get_handle: remove. * libguile/bitvectors.c, libguile/bytevectors.c, libguile/strings.c, libguile/vectors.c: fix base = 0 in the array handle. * libguile/vectors.c: (vector_handle_set, vector_handle_ref): do not use h->dims.
2014-01-27Match uniform_vector_elements with vector_elementsDaniel Llorens1-19/+11
* libguile/vectors.c - (scm_vector_writable_elements): allow any non-uniform rank 1 array, after the doc. Match the implementation with scm_uniform_vector_elements. - (scm_vector_elements): after the above. * libguile/uniform.c - (scm_uniform_vector_writable_elements): ditto for uniform rank 1 arrays. * libguile/sort.c - revert the changes in 7a6fd9, except for the argument type test; allow what scm_vector_(writable_)elements allows.
2014-01-27Online documentation for vector-ref, vector-set!Daniel Llorens1-53/+35
* libguile/vectors.c: (scm_vector_ref, scm_vector_set!): embed the comments as documentation.
2014-01-27vector-length rejects non vector? argDaniel Llorens1-17/+15
* libguile/vectors.c - scm_c_vector_length: error if SCM_I_IS_VECTOR (v) fails. - scm_vector_length: Documentation for vector-length.
2014-01-27vector-ref, vector-set! reject non vector? argsDaniel Llorens1-33/+1
* libguile/vectors.c: (scm_c_vector_ref, scm_c_vector_set_x): throw type error if v is not vector?.
2014-01-27Identify scm_is_vector with scm_is_simple_vectorDaniel Llorens1-8/+1
This patch fixes the bug (vector-ref #1@1(1 2 3) 1) => 2. * libguile/vectors.c: (scm_is_vector): just as scm_is_simple_vector. * libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c, libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector. * libguile/sort.c - scm_restricted_vector_sort_x: use scm_array_handle_writable_elements instead of scm_vector_writable_elements, to work with non-vector rank-1 array objects. - scm_sort_x: check for scm_is_array instead of scm_is_vector. Rank check is in restricted_vector_sort_x. - scm_sort: ditto. - scm_stable_sort_x: like scm_restricted_vector_sort_x. - scm_stable_sort: like scm_sort. * test-suite/tests/arrays.test: fix header. * test-suite/tests/random.test: new coverage test covering random:normal-vector! * test-suite/Makefile.am: include random.test in make check.
2012-07-06Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-2/+3
Conflicts: libguile/expand.c libguile/hashtab.c libguile/ports.c libguile/vectors.c libguile/weaks.c module/language/ecmascript/compile-tree-il.scm module/language/tree-il/effects.scm module/language/tree-il/fix-letrec.scm module/language/tree-il/peval.scm test-suite/tests/peval.test
2012-07-02Use `void *' instead of `GC_PTR' internally.Ludovic Courtès1-8/+7
* libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c, libguile/hashtab.c, libguile/numbers.c, libguile/ports.c, libguile/smob.c, libguile/struct.c, libguile/vectors.c, libguile/weaks.c: Use `void *' instead of `GC_PTR'.
2011-10-24remove weak pairs, rewrite weak vectorsAndy Wingo1-141/+38
* libguile/weak-vector.c: * libguile/weak-vector.h: Renamed from weaks.[ch]. Remove weak pairs. They were not safe to access with `car' and `cdr'. Remove weak alist vectors, as we have weak tables and sets. Reimplement weak vectors, moving the implementation here. * libguile/vectors.c: * libguile/vectors.h: Remove the extra header word. Use scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak vectors. * libguile/snarf.h: Remove the extra header word in vectors. * libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock): Instead of weak pairs, store thread-owned mutexes in a list of one-element weak vectors. * libguile/guardians.c (finalize_guarded): Similarly, store object guardians in a list of one-element weak vectors. * libguile/modules.c (scm_module_reverse_lookup): We no longer need to handle the case of weak references. * libguile/print.c (iprin1): Use the standard vector accessor to print vectors. * libguile.h: * libguile/Makefile.am: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/goops.c: * libguile/init.c: * libguile/objprop.c: * libguile/struct.c: Update includes. * module/ice-9/weak-vector.scm: Load weak vector definitions using an extension instead of %init-weaks-builtins. * test-suite/tests/weaks.test: Use the make-...-hash-table names instead of the old alist vector names.
2011-05-15scm_wta_* procedures replace SCM_WTA_* macrosAndy Wingo1-4/+7
* libguile/__scm.h: Move all the SCM_WTA and SCM_GASSERT macros out of here. Also remove the scm_call_generic declarations. * libguile/deprecated.h (SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1): (SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_N): Deprecate. See below for their replacements. (SCM_GASSERT0, SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn): Deprecate these too. (SCM_WTA_DISPATCH_1_SUBR): Deprecate this strange thing. (scm_call_generic_0, scm_call_generic_1, scm_call_generic_2): (scm_call_generic_3, scm_apply_generic): Remove, indicating their replacements. * libguile/print.c (iprin1): * libguile/eq.c (scm_equal_p): Use scm_call_2 instead of scm_call_generic_2. * libguile/goops.h: * libguile/goops.c: Remove scm_{call,apply}_generic definitions. (scm_wta_dispatch_0, scm_wta_dispatch_1, scm_wta_dispatch_2): (scm_wta_dispatch_n): New procedures, replacing the SCM_WTA macros. * libguile/numbers.c (scm_lcm): * libguile/procs.c (scm_setter): Remove uses of SCM_GASSERT. * libguile/numbers.c (scm_lcm): * libguile/procs.c (scm_setter): * libguile/vectors.c: Use the procedural scm_wta routines instead of the SCM_WTA macros.
2011-05-13correct use of SCM2PTR in SCM_I_REGISTER_DISAPPEARING_LINK formsAndy Wingo1-2/+4
* libguile/hashtab.c (set_weak_cdr): * libguile/vectors.c (scm_c_vector_set_x): * libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair): (scm_doubly_weak_pair): Use SCM2PTR for the target of SCM_I_REGISTER_DISAPPEARING_LINK calls.
2011-05-13more care regarding SCM_PACK and SCM_UNPACKAndy Wingo1-3/+3
* libguile/control.c (reify_partial_continuation): * libguile/eval.c (RETURN_BOOT_CLOSURE): * libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x) * libguile/frames.h (SCM_FRAME_SET_RETURN_ADDRESS): (SCM_FRAME_SET_MV_RETURN_ADDRESS, SCM_FRAME_SET_DYNAMIC_LINK): * libguile/goops.c (scm_class_of, scm_primitive_generic_generic) (scm_c_extend_primitive_generic, compute_getters_n_setters) (scm_sys_initialize_object): * libguile/guardians.c (finalize_guarded): * libguile/list.c (SCM_I_CONS): * libguile/macros.c (scm_i_make_primitive_macro) (scm_make_syntax_transformer): * libguile/memoize.c (MAKMEMO, SCM_MAKE_MEMOIZER) (SCM_MAKE_REST_MEMOIZER): * libguile/modules.c (scm_module_reverse_lookup) * libguile/print.c (iprin1): * libguile/promises.c (scm_make_promise) * libguile/srcprop.c (scm_make_srcprops): * libguile/vectors.c (scm_c_vector_ref): * libguile/vm-engine.c (vm_engine) * libguile/vm-i-scheme.c (REL, add1, sub1): * libguile/vm-i-system.c (new_frame, call_cc) * libguile/weaks.h (SCM_WEAK_PAIR_WORD_DELETED_P): Be more careful about SCM_PACK / SCM_UNPACK.
2011-02-14fix fencepost error in vector-move-left! and -right!Ian Price1-2/+2
* libguile/vectors.c (scm_vector_move_right_x, scm_vector_move_left_x): Fix edge case.
2010-08-04fix vector-move-right! and vector-move-left!Andy Wingo1-2/+8
* libguile/vectors.c (scm_vector_move_left_x, scm_vector_move_right_x): Fix some bugs reported by Michael Lucy -- both variants would happily write beyond the end, and vector-move-right! didn't increment the counter before copying in the reverse direction. * test-suite/tests/vectors.test ("vector-move-left!"): ("vector-move-right!"): Add tests.
2010-04-09remove libguile/lang.h, deprecate %nil (in favor of #nil)Andy Wingo1-2/+1
* libguile/Makefile.am: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: Remove lang.c and lang.h. * libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here. * module/ice-9/deprecated.scm (%nil): %nil definition moved here. * libguile/alist.c: * libguile/async.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/list.c: * libguile/load.c: * libguile/options.c: * libguile/posix.c: * libguile/print.c: * libguile/promises.c: * libguile/sort.c: * libguile/throw.c: * libguile/trees.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weaks.c: * srfi/srfi-1.c: <libguile/lang.h> references removed.
2010-01-07clean up includes in vectors.[ch]Andy Wingo1-5/+1
* libguile/vectors.h: * libguile/vectors.c: Clean up the includes... mostly.
2009-12-29fix bug in string array implementation type maskAndy Wingo1-3/+2
* libguile/strings.c (SCM_ARRAY_IMPLEMENTATION): The mask for the string array implementation should be 0x7f, without masking out 0x2. Otherwise numbers were being thought to be vectors! * test-suite/tests/unif.test: Add test. * libguile/vectors.c (SCM_ARRAY_IMPLEMENTATION): Only register one implementation, because weak vectors can be checked with the mask & ~2, and the functions are the same.
2009-12-15Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' & co.Ludovic Courtès1-3/+3
* libguile/bitvectors.c, libguile/srfi-4.c, libguile/strings.c, libguile/vectors.c: Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' and `SCM_VECTOR_IMPLEMENTATION' invocations.
2009-12-05decruftify scm_sys_protectsAndy Wingo1-2/+0
* libguile/root.h * libguile/root.c (scm_sys_protects): It used to be that for some reason we'd define a special array of "protected" values. This was a little silly, always, but with the BDW GC it's completely unnecessary. Also many of these variables were unused, and none of them were good API. So remove this array, and either eliminate, make static, or make internal the various values. * libguile/snarf.h: No need to generate calls to scm_permanent_object. * guile-readline/readline.c (scm_init_readline): No need to call scm_permanent_object. * libguile/array-map.c (ramap, rafe): Remove the dubious nullvect optimizations. * libguile/async.c (scm_init_async): No need to init scm_asyncs, it is no more. * libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is no more. * libguile/gc.c: Make scm_protects a static var. (scm_storage_prehistory): Change the sanity check to use the address of protects. (scm_init_gc_protect_object): No need to clear the scm_sys_protects, as it is no more. * libguile/keywords.c: Make the keyword obarray a static var. * libguile/numbers.c: Make flo0 a static var. * libguile/objprop.c: Make object_whash a static var. * libguile/properties.c: Make properties_whash a static var. * libguile/srcprop.h: * libguile/srcprop.c: Make scm_source_whash a global with internal linkage. * libguile/strings.h: * libguile/strings.c: Make scm_nullstr a global with internal linkage. * libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect, it's unused.
2009-11-02Allocate vectors in a contiguous memory area.Ludovic Courtès1-48/+33
* libguile/vectors.c (scm_c_make_vector): Allocate the whole vector and header with `scm_gc_malloc ()'. (scm_vector_copy): Use `scm_c_make_vector ()'. (scm_i_vector_free, MAKE_WEAK_VECTOR): Remove. (allocate_weak_vector): Rename to... (make_weak_vector): ... this. Change to return the whole weak vector, allocated with `scm_gc_malloc_pointerless ()'. (scm_i_make_weak_vector, scm_i_make_weak_vector_from_list): Use `make_weak_vector ()'. * libguile/vectors.h (SCM_I_VECTOR_HEADER_SIZE): New macro. (SCM_I_VECTOR_ELTS): Write in terms of `SCM_I_VECTOR_WELTS ()'. (SCM_I_VECTOR_WELTS): Update to the new representation. (SCM_I_WVECT_EXTRA, SCM_I_SET_WVECT_EXTRA): Likewise. (SCM_I_WVECT_GC_CHAIN, SCM_I_SET_WVECT_GC_CHAIN): Remove. * libguile/weaks.h (SCM_I_WVECT_DELTA, SCM_I_SET_WVECT_DELTA): Remove.
2009-11-01Merge branch 'bdw-gc-static-alloc'Ludovic Courtès1-2/+2
Conflicts: acinclude.m4 libguile/__scm.h libguile/bdw-gc.h libguile/eval.c
2009-09-14Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.Ludovic Courtès1-1/+1
* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'. * libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated. Update to LGPLv3+.
2009-09-02Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-allocLudovic Courtès1-122/+40
Conflicts: acinclude.m4 libguile/strings.c
2009-08-28Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-122/+31
Conflicts: libguile/Makefile.am libguile/bytevectors.c libguile/gc-card.c libguile/gc-mark.c libguile/programs.c libguile/srcprop.c libguile/srfi-14.c libguile/symbols.c libguile/threads.c libguile/unif.c libguile/vm.c
2009-08-18Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-9/+18
Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
2009-07-19add registry of vector constructors, make-generalized-vectorAndy Wingo1-0/+2
* libguile/generalized-vectors.h: * libguile/generalized-vectors.c: Add a registry of vector constructors. (scm_make_generalized_vector): New public function, constructs a vector of a given type. * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/srfi-4.c: * libguile/strings.c: * libguile/vectors.c: Register vector constructors. * libguile/extensions.c (scm_init_extensions): No need to NULL the list of registered extensions here, the static init does it for us. Allows scm_c_register_extension to be called before scm_init_extensions. * libguile/init.c (scm_i_init_guile): Move array initialization earlier, so e.g. scm_init_strings has access to a valid list of array element types when registering its vector constructor.
2009-07-19generic vector ops to own fileAndy Wingo1-130/+1
* libguile/Makefile.am: * libguile/vectors.c: * libguile/vectors.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: Move generic vector ops off into their own file too. The implementation is now based on the generic array-handle infrastructure. * libguile.h: * libguile/array-map.c: * libguile/bitvectors.c: * libguile/random.c: * libguile/srfi-4.c: Update includers.
2009-07-19add generic array implementation facilityAndy Wingo1-0/+35
* libguile/array-handle.c (scm_i_register_array_implementation): (scm_i_array_implementation_for_obj): Add generic array facility, which will (in a few commits) detangle the array code. (scm_array_get_handle): Use the generic array facility. Note that scm_t_array_handle no longer has ref and set function pointers; instead it has a pointer to the array implementation. It is unlikely that code out there used these functions, however, as the supported way was through scm_array_handle_ref/set_x. (scm_array_handle_pos): Move this function here from arrays.c. (scm_array_handle_element_type): New function, returns a Scheme value representing the type of element stored in this array. * libguile/array-handle.h (scm_t_array_element_type): New enum, for generically determining the type of an array. (scm_array_handle_rank): (scm_array_handle_dims): These are now just #defines. * libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/srfi-4.c: * libguile/strings.c: * libguile/vectors.c: Register array implementations for all of these. * libguile/inline.h: Update for array_handle_ref/set change. * libguile/deprecated.h: Need to include arrays.h now.
2009-07-19rename unif.[ch] to arrays.[ch]Andy Wingo1-1/+1
* libguile/Makefile.am: * libguile/unif.c: * libguile/unif.h: * libguile/arrays.c: * libguile/arrays.h: Rename unif.[ch] to arrays.[ch]. * libguile.h: * libguile/array-handle.c: * libguile/array-map.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/eq.c: * libguile/gc-card.c: * libguile/gc-malloc.c: * libguile/gc-mark.c: * libguile/gc.c: * libguile/init.c: * libguile/inline.h: * libguile/print.c: * libguile/random.c: * libguile/read.c: * libguile/socket.c: * libguile/sort.c: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/strports.c: * libguile/vectors.c: * libguile/vectors.h: Update includers.
2009-07-19bitvector exodus from unif.[ch]Andy Wingo1-0/+1
* libguile/Makefile.am: * libguile/unif.c: * libguile/unif.h: * libguile/bitvectors.c: * libguile/bitvectors.h: Move bitvector functionality out of unif.[ch]. * libguile/array-handle.c: * libguile/array-map.c: * libguile/init.c: * libguile/read.c: * libguile/srfi-4.c: * libguile/vectors.c: Oh, what a tangled web we weave...
2009-07-19rename ramap.[ch] to array-map.[ch]Andy Wingo1-1/+1
* libguile/array-map.c: * libguile/array-map.h: Rename from ramap.c and ramap.h. * libguile.h: * libguile/Makefile.am: * libguile/eq.c: * libguile/init.c: * libguile/sort.c: * libguile/unif.c: * libguile/vectors.c: All referrers changed.
2009-06-22Make bytevectors accessible using the generalized-vector API.Ludovic Courtès1-3/+11
As a side effect, this allows compilation of literal bytevectors ("#vu8(...)"), which gets done by the generic array handling of the GLIL->assembly compiler. * doc/ref/api-compound.texi (Generalized Vectors): Mention bytevectors. (Arrays, Array Syntax): Likewise. * doc/ref/api-data.texi (Bytevectors as Generalized Vectors): New node. * libguile/bytevectors.c (scm_i_bytevector_generalized_set_x): New. * libguile/bytevectors.h (scm_i_bytevector_generalized_set_x): New declaration. * libguile/srfi-4.c (scm_i_generalized_vector_type, scm_array_handle_uniform_element_size, scm_array_handle_uniform_writable_elements): Add support for bytevectors. * libguile/unif.c (type_creator_table): Add `vu8'. (bytevector_ref, bytevector_set): New functions. (memoize_ref, memoize_set): Add support for bytevectors. * libguile/vectors.c (scm_is_generalized_vector, scm_c_generalized_vector_length, scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x): Add support for bytevectors. * test-suite/tests/bytevectors.test ("Generalized Vectors"): New test set.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2009-01-31Don't register disappearing links for non-heap objects.Ludovic Courtès1-3/+3
* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP, SCM_I_REGISTER_DISAPPEARING_LINK): New. * libguile/vectors.c (scm_c_vector_set_x): Use `SCM_I_REGISTER_DISAPPEARING_LINK ()' instead of `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'. * libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair, scm_doubly_weak_pair): Likewise.
2008-09-16Use immutable cells for vectors.Ludovic Courtès1-1/+1
* libguile/vectors.c (scm_c_make_vector): Use `scm_immutable_cell ()'.
2008-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-1/+4
Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+4
2008-09-10Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into ↵Ludovic Courtès1-6/+6
boehm-demers-weiser-gc Conflicts: libguile/Makefile.am libguile/coop-pthreads.c libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.c libguile/private-gc.h test-suite/tests/environments.nottest
2008-09-10Use thread-local allocation (significant perf. improvement!); added the ↵Ludovic Courtes1-1/+1
`boehm-gc.h' header. * libguile/Makefile.am (modinclude_HEADERS): Added `boehm-gc.h'. * libguile/coop-defs.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/coop-threads.h: Likewise. * libguile/coop.c: Likewise. * libguile/gc.c: Likewise. (scm_storage_prehistory): Invoke `GC_init ()'. * libguile/guardians.c: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/inline.h: Likewise. (scm_double_cell): Use `GC_MALLOC' instead of `GC_malloc'. * libguile/pthread-threads.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/smob.c: Likewise. * libguile/smob.h: Likewise. * libguile/struct.c: Likewise. * libguile/threads.c: Likewise. * libguile/weaks.c: Likewise. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-51
2008-09-05Fixed `list->weak-vector'.Ludovic Courtes1-27/+67
* 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
2008-09-05First stab at implementing weak hash tables and vectors. Unable to run the ↵Ludovic Courtes1-6/+50
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
2007-01-25*** empty log message ***Han-Wen Nienhuys1-7/+0
2007-01-22(s_scm_vector_move_right_x): complain about naming.Han-Wen Nienhuys1-0/+7
2006-11-29Changes from arch/CVS synchronizationLudovic Courtès1-6/+6
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1