summaryrefslogtreecommitdiff
path: root/libguile/vectors.c
AgeCommit message (Collapse)AuthorFilesLines
2016-07-11Do not use array handles in scm_vectorDaniel Llorens1-34/+18
* libguile/vectors.c (scm_vector): Use SCM_I_VECTOR_WELTS on new vector instead of generic scm_vector_elements; cf. scm_vector_copy(). (scm_vector_elements): Forward to scm_vector_writable_elements(). (scm_vector_writable_elements): Remove special error message for weak vector arg. * libguile/generalized-vectors.c (SCM_VALIDATE_VECTOR_WITH_HANDLE): Remove unused macro. * libguile/array-handle.c (scm_array_handle_elements): Forward to scm_array_handle_writable_elements().
2014-02-09Remove array impl. registry; instead, hard-code array handle creationAndy Wingo1-34/+0
* libguile/array-handle.h (scm_t_vector_ref, scm_t_vector_set): Rename from scm_t_array_ref, scm_t_array_set. These were named scm_i_t_array_ref and scm_i_t_array_set in 1.8 and 2.0. Change to take the vector directly, instead of the array handle. In this way, generic array handles are layered on top of specific implementations of backing stores. Remove scm_t_array_implementation, introduced in 2.0 but never documented. It was a failed attempt to layer the array implementation that actually introduced too many layers, as it prevented the "vref" and "vset" members of scm_t_array_handle (called "ref" and "set" in 1.8, not present in 2.0) from specializing on array backing stores. (scm_i_register_array_implementation) (scm_i_array_implementation_for_obj): Remove these internal interfaces. (scm_t_array_handle): Adapt to scm_t_vector_ref / scm_t_vector_set change. (scm_array_handle_ref, scm_array_handle_set): Adapt to change in vref/vset prototype. * libguile/array-handle.c (scm_array_get_handle): Inline all the necessary initializations here for all specific array types. * libguile/array-map.c (rafill, racp, ramap, rafe, array_index_map_1): * libguile/arrays.c: Remove array implementation code. * libguile/bitvectors.h: * libguile/bitvectors.c: Remove array implementation code. (scm_i_bitvector_bits): New internal interface. * libguile/bytevectors.c: Remove array implementation code. * libguile/srfi-4.h: Remove declarations for internal procedures that don't exist (!). * libguile/strings.c: Remove array implementation code. * libguile/vectors.c: Remove array implementation code.
2014-02-08SCM_I_IS_VECTOR only true for tc7_vector, not weak vectorsAndy Wingo1-2/+2
* libguile/tags.h (SCM_TYP7S, SCM_HAS_TYP7S): Remove these, as we no longer do the differs-by-one-bit thing for vectors and weak vectors. * libguile/vectors.h (SCM_I_IS_VECTOR): Use SCM_HAS_TYP7. (SCM_I_IS_NONWEAK_VECTOR): Remove. * libguile/vm-engine.c (vector-length, vector-ref, vector-set!) (vector-ref/immediate, vector-set!/immediate): We can inline these instructions completely now. * libguile/vm.c (vm_error_not_a_vector, vm_error_out_of_range): New error conditions.
2014-02-08Merge commit '24cac6554073bb6e691605cd6ac6196f3c0851a3'Andy Wingo1-68/+20
Conflicts: libguile/vectors.c
2014-02-08Merge commit '5cfeff11cc58148c58a85a879fd7a3e7cfbbe8e2'Andy Wingo1-53/+42
Conflicts: libguile/vectors.c
2014-02-08Deprecate the use of the vector interface on arraysAndy Wingo1-9/+40
* libguile/vectors.c (scm_is_vector): Deprecate use on weak vectors and arrays. (scm_is_simple_vector): Deprecate use on weak vectors. (scm_vector_length, scm_c_vector_ref, scm_c_vector_set_x): Deprecate use on arrays. * libguile/sort.c: Adapt to check explicitly for arrays.
2014-02-08Deprecate use of vector-length, vector-ref, vector-set! as primitive-genericsAndy Wingo1-7/+28
* libguile/vectors.c (scm_vector_length, scm_c_vector_ref): (scm_c_vector_set_x): Deprecate the use of vector-length, vector-ref, and vector-set! as primitive generics.
2014-02-07Merge commit '9b5da400dde6e6bc8fd0e318e7ca1feffa5870db'Andy Wingo1-12/+3
Conflicts: libguile/vectors.c test-suite/tests/weaks.test
2014-02-07Deprecate vector-ref, vector-length, vector-set! on weak vectorsAndy Wingo1-17/+33
* libguile/vectors.c (scm_vector_length, scm_c_vector_length): (scm_c_vector_ref, scm_c_vector_set_x): Deprecate the use of these procedures on weak vectors. * test-suite/tests/guardians.test: * test-suite/tests/weaks.test: Adapt test suites.
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
2005-01-11(SCM_ARRAYP, SCM_I_ARRAYP): Renamed former to latter internalMarius Vollmer1-12/+12
version. Changed all uses. (scm_tc16_array, scm_i_tc16_array, scm_tc16_enclosed_array, scm_i_tc16_enclosed_array, SCM_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_FLAG_CONTIGUOUS, SCM_ENCLOSE_ARRAYP, SCM_I_ENCLOSE_ARRAYP, SCM_ARRAY_NDIM, SCM_I_ARRAY_NDIM, SCM_ARRAY_CONTP, SCM_I_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_I_ARRAY_MEM, SCM_ARRAY_V, SCM_I_ARRAY_V, SCM_ARRAY_BASE, SCM_I_ARRAY_BASE, SCM_ARRAY_DIMS, SCM_I_ARRAY_DIMS, scm_t_array, scm_i_t_array): Likewise. (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG): Moved from unif.h to unif.c. (scm_c_array_rank): New. (scm_array_rank): Reimplement using it.