summaryrefslogtreecommitdiff
path: root/libguile/struct.c
AgeCommit message (Collapse)AuthorFilesLines
2012-07-02Use `void *' instead of `GC_PTR' internally.Ludovic Courtès1-1/+1
* 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'.
2012-03-08use the new finalizer helpersAndy Wingo1-11/+3
* libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/numbers.c (make_bignum): Use the new API.
2012-02-19use the new finalizer helpersAndy Wingo1-11/+3
* libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port, scm_c_make_port_with_encoding) (open_iconv_descriptors) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/weak-set.c (weak_gc_finalizer) (scm_c_register_weak_gc_callback) * libguile/weak-table.c (scm_c_register_weak_gc_callback) (weak_gc_finalizer) * libguile/numbers.c (make_bignum): Use the new API.
2012-02-08Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-9/+15
Conflicts: GUILE-VERSION libguile/gc-malloc.c libguile/ports.c
2012-02-02Improve the usage of variable names in C docstrings.Bake Timmons1-9/+15
* libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/filesys.c: * libguile/foreign.c: * libguile/generalized-arrays.c: * libguile/hashtab.c: * libguile/ioext.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/promises.c: * libguile/simpos.c: * libguile/socket.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/weak-table.c: * libguile/weak-vector.c: Make the variable names in the C docstrings more consistent. Replace a few instances of @var with @code when appropriate.
2012-01-31Revert "add SCM_HEAP_OBJECT_BASE"Andy Wingo1-1/+1
This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3. Conflicts: libguile/foreign.c
2011-11-24deprecate make-vtable-vtableAndy Wingo1-2/+35
* libguile/struct.h: * libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can handle most of the use cases with make-vtable, and we don't want to promote the creation of new roots to the type hierarchy. (scm_i_make_vtable_vtable): The internal replacement.
2011-11-24Scheme standard-vtable-fields bindingAndy Wingo1-0/+1
* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to Scheme.
2011-11-24add Scheme binding for scm_standard_vtable_vtableAndy Wingo1-0/+1
* libguile/struct.c (scm_init_struct): Export <standard-vtable> to Scheme.
2011-11-08locking for putc, putsAndy Wingo1-10/+10
* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions.
2011-10-24add SCM_HEAP_OBJECT_BASEAndy Wingo1-1/+1
* libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro. Given a SCM, returns a pointer to the start of its memory area on the heap. * libguile/bytevectors.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/numbers.h: * libguile/ports.c: * libguile/smob.c: * libguile/struct.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it.
2011-10-24remove weak pairs, rewrite weak vectorsAndy Wingo1-1/+0
* 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-01deprecate scm_struct_tableAndy Wingo1-20/+6
* libguile/goops.h: * libguile/goops.c (scm_i_define_class_for_vtable): New internal helper, defines a class for a vtable, relying on the name slot being set correctly. (scm_class_of, create_struct_classes): Use the local vtable-to-class map instead of scm_struct_table. * libguile/struct.h (SCM_STRUCT_TABLE_NAME, SCM_SET_STRUCT_TABLE_NAME) (SCM_STRUCT_TABLE_CLASS, SCM_SET_STRUCT_TABLE_CLASS, scm_struct_table) (scm_struct_create_handle): Deprecate these internals of the map between structs and classes. * libguile/deprecated.h: * libguile/deprecated.c (scm_struct_create_handle): Deprecated code over here now.
2010-11-19fix a number of assumptions that a pointer could fit into a longAndy Wingo1-1/+2
* libguile/debug.c: * libguile/eval.c: * libguile/frames.c: * libguile/objcodes.c: * libguile/print.c: * libguile/programs.c: * libguile/read.c: * libguile/struct.c: * libguile/vm.c: Fix a number of instances in which we assumed we could fit a pointer into a long.
2010-08-29add flag to vtables to indicate that their layout is validAndy Wingo1-9/+21
* libguile/struct.h (SCM_VTABLE_FLAG_VALIDATED): New flag, indicates that the layout of a vtable has been validated. The other flags have been renumbered. * libguile/struct.c (scm_i_struct_inherit_vtable_magic): Set the VALIDATED flag if everything goes through. (scm_struct_vtable_p): If the struct should be a vtable but isn't validated, throw an error. (scm_make_vtable_vtable): Validate the incoming user_fields layout bit. Set the VALIDATED flag. (scm_c_make_structv): Add a comment about the case in which we delay scm_i_struct_inherit_vtable_magic.
2010-05-04check layout when making vtablesAndy Wingo1-2/+42
* libguile/struct.c (scm_is_valid_vtable_layout): New private layout validating function. (scm_i_struct_inherit_vtable_magic): Do a more proper layout validation, and don't abort.
2010-05-01optimize and bugfix make-struct VM opcodeAndy Wingo1-7/+6
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for make-struct change. * libguile/struct.c (scm_i_alloc_struct): Use scm_words instead of scm_gc_malloc to simplify the code and inline the call to GC_MALLOC. * module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile make-struct/no-tail to make-struct. * module/language/tree-il/primitives.scm (define-primitive-expander): Allow a conditional branch of #f to aboirt inlining. (make-struct): Expand into make-struct/no-tail in the case that tail-size is 0. * libguile/vm-i-scheme.c (make-struct): Adapt to always assume tail-size is 0. Inline allocation if possible. Don't decrement the SP past live objects on the stack, which could cause GC to miss references. Use the NULLSTACK macro.
2010-01-26Recognize structs with both "pr" and "pw" flags as simple.Ludovic Courtès1-12/+5
* libguile/struct.c (set_vtable_layout_flags): Keep the `SCM_VTABLE_FLAG_SIMPLE' flag when VTABLE has a mixture of `r' and `w' fields. * libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE): Adjust comment.
2010-01-25Reinstate 2-word displacement for structs.Ludovic Courtès1-0/+5
* libguile/struct.c (scm_init_struct): Reinstate 2-word displacement removed by 01e74380f6170b5cb1105e5df9a368ab257420ef.
2010-01-23Slightly improve comments and style in `struct.c'.Ludovic Courtès1-14/+14
* libguile/struct.c (scm_i_struct_inherit_vtable_magic): Comment. Punctuate comments within the body, have them follow GCS. (scm_make_vtable_vtable): Clarify comments.
2010-01-23Clarify GC-registered displacements for structs.Ludovic Courtès1-3/+4
* libguile/struct.c (scm_init_struct): Remove unneeded `GC_REGISTER_DISPLACEMENT ()' call. Comment the remaining one.
2010-01-23Optimize struct initialization and accessors for the common case.Ludovic Courtès1-136/+229
* libguile/struct.c (set_vtable_layout_flags): New function. (scm_i_struct_inherit_vtable_magic): Use it. (scm_struct_init): Optimize the case where HANDLE's vtable has the `SCM_VTABLE_FLAG_SIMPLE' flag. (scm_struct_ref): Likewise. (scm_struct_ref): Likewise, when `SCM_VTABLE_FLAG_SIMPLE_RW' is also set. * libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Update comment for the next-to-last hidden field. (scm_vtable_index_reserved_6): Rename to... (scm_vtable_index_size): ... this. (SCM_VTABLE_FLAG_RESERVED_0): Rename to... (SCM_VTABLE_FLAG_SIMPLE): ... this. (SCM_VTABLE_FLAG_RESERVED_1): Rename to... (SCM_VTABLE_FLAG_SIMPLE_RW): ... this. * test-suite/tests/structs.test ("low-level struct procedures")["struct-ref", "struct-set!", "struct-ref out-of-range", "struct-set! out-of-range"]: New tests.
2009-12-08scm_i_alloc_struct does not take a "what" argAndy Wingo1-4/+3
* libguile/struct.h: * libguile/struct.c (scm_i_alloc_struct): Change to not take a "what" argument. Callers changed.
2009-12-08make some applicable struct vtable-vtable public to CAndy Wingo1-9/+8
* libguile/struct.h (scm_standard_vtable_vtable) (scm_applicable_struct_vtable_vtable) (scm_applicable_struct_with_setter_vtable_vtable) * libguile/struct.c: Make these stock meta-tables public to C.
2009-12-07add scm_c_make_struct[v]Andy Wingo1-65/+107
* libguile/struct.h (scm_c_make_struct, scm_c_make_structv): New functions with which you can make a struct without consing a rest list. * libguile/struct.c (scm_struct_init): Refactor to take an array of init values, not a list. (scm_make_struct, scm_make_vtable_vtable): Pull the rest arg out into a list and pass it down to the new array-taking functions. * libguile/memoize.c: Remove a neeless #include <alloca>.
2009-12-05some scm_i_init_guile cleanupsAndy Wingo1-6/+0
* libguile/init.c (scm_i_init_guile): Since hash tables are tc7 objects, things that depend on hash tables no longer depend on smobs, so move smob_prehistory up a bit. No more struct_prehistory. * libguile/struct.h: * libguile/struct.c (scm_struct_prehistory): Remove empty function.
2009-11-26limn goops flags, remove foreign objs, rename entity to applicable-structAndy Wingo1-91/+88
* libguile/goops.c (scm_class_applicable_struct) (scm_class_applicable_struct_with_setter) (scm_class_applicable_struct_class): Rename from scm_class_entity, scm_class_entity_with_setter, and scm_class_entity_class. (scm_class_simple_method): Removed; this abstraction is not used. (scm_class_foreign_class, scm_class_foreign_object): Remove these, they are undocumented and unused. They might come back later. (scm_sys_inherit_magic_x): Simply inherit the vtable flags from the class's class. Flags are about layout, and it is the class that determines the layout of the instance. (scm_basic_basic_make_class): Don't bother setting GOOPS_OR_VALID, inherit-magic will do that. (scm_basic_make_class): Inherit magic after setting the layout. Allows the struct magic checker to do its job. (scm_accessor_method_slot_definition): Move implementation to Scheme. Removes the need for the accessor flag. (scm_sys_allocate_instance): Adapt to scm_i_alloc_struct name change, and that alloc-struct will handle finalization. (scm_compute_applicable_methods): Remove accessor check, as it's unnecessary. (scm_make): Adapt to new generic slot order, and no more simple-method. (create_standard_classes): What was the GF slot "dispatch-procedure" is now the applicable-struct slot "procedure". No more foreign class, foreign object, or simple method. Rename <entity> and friends to <applicable-struct> and friends. No more entity-with-setter -- though perhaps it will come back too. Instead generic-with-setter is its own thing. * libguile/goops.h (SCM_CLASSF_METACLASS): "A goops class that is a vtable" -- no need for a separate flag. (SCM_CLASSF_FOREIGN, SCM_CLASSF_SIMPLE_METHOD) (SCM_CLASSF_ACCESSOR_METHOD): Removed these unused flags. (SCM_ACCESSORP): Removed. Renumber generic slots, rename entity classes, and remove the foreign class, foreign object, and simple method classes. * libguile/struct.c (scm_i_struct_inherit_vtable_magic): New function, called when making new vtables.applicable structs (scm_i_alloc_struct): Remove 8-bit alignment check, as libGC guarantees this for us. Handle finalizer registration here. (scm_make_struct): Factor some things to scm_i_alloc_struct and scm_i_struct_inherit_vtable_magic. (scm_make_vtable_vtable): Adapt to scm_i_alloc_struct name change. * libguile/struct.h (scm_i_alloc_struct): Change name from scm_alloc_struct, and make internal. * module/oop/goops.scm (oop): Don't declare #:replace <class> et al, because <class> isn't defined in the core any more. (accessor-method-slot-definition): Defined in Scheme now. Remove <foreign-object> methods. (initialize on <class>): Prep layout before inheriting magic, as in scm_basic_make_class. * module/oop/goops/dispatch.scm (delayed-compile) (memoize-effective-method!): Adapt to 'procedure slot name change.
2009-11-26a very big commit cleaning up structs & goops. also applicable structs.Andy Wingo1-173/+183
I tried to split this one, and I know it's a bit disruptive, but this stuff really is one big cobweb. So instead we'll pretend like these are separate commits, by separating the changelog. Applicable struct runtime support. * libguile/debug.c (scm_procedure_source): * libguile/eval.c (scm_trampoline_0, scm_trampoline_1) (scm_trampoline_2): * libguile/eval.i.c (CEVAL): * libguile/goops.c (scm_class_of): * libguile/procprop.c (scm_i_procedure_arity): * libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow for applicable structs. Whee! * libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym for scm_vtable_index_self. (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer. (scm_struct_i_free): Alias scm_vtable_index_instance_finalize. (scm_struct_i_flags): Alias scm_vtable_index_flags. (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now. (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand. Hidden slots. * libguile/struct.c (scm_make_struct_layout): Add support for "hidden" fields, writable fields that are not visible to make-struct. This allows us to add fields to vtables and not break existing make-struct invocations. (scm_struct_ref, scm_struct_set_x): Always get struct length from the vtable. Support hidden fields. * libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New slot classes, to correspond to the new vtable slots. (scm_sys_prep_layout_x): Turn hidden slots into 'h'. (build_class_class_slots): Reorder the class slots to account for vtable fields coming out of negative-land, for name as a vtable slot, and for hidden fields. (create_standard_classes): Define <hidden-slot> and <protected-hidden-slot>. Clean up struct.h. * libguile/struct.h: Lay things out cleaner. There are no more hidden (negative) words. Names are nicer. The exposition is nicer. But the basics are the same. The incompatibilities are that <vtable> has more slots now, and that scm_alloc_struct's signature has changed. The former is ameliorated by the "hidden" slots mentioned before, and the latter, well, it was always a very internal thing... (scm_t_struct_finalize): New type, a finalizer function to be run when instances of a vtable are collected. (scm_t_struct_free): Removed, structs' data is managed by the GC now, and not freed by vtable functions. * libguile/struct.c: (scm_vtable_p): Now we keep flags on vtable-vtables, so this check is cheaper. (scm_alloc_struct): No hidden words. Yippee. (struct_finalizer_trampoline): Entersify. (scm_make_struct): No need to babysit extra words, though now we have to babysit flags. Propagate the vtable, applicable, and setter flags appropriately. (scm_make_vtable_vtable): Update for new simplicity. (scm_print_struct): A better printer. (scm_init_struct): Define <applicable-struct-vtable>, a magical vtable like CL's funcallable-standard-class. Also define <applicable-struct-with-setter-vtable>. Remove foreign object implementation. * libguile/goops.h: * libguile/goops.c (scm_make_foreign_object, scm_make_class) (scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these were undocumented and unworking. Clean up goops.h, a little. * libguile/goops.h: * libguile/goops.c: Also clean up. * module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset index.
2009-11-17Fix C99-style declarations after statements.Ludovic Courtès1-1/+2
* libguile/eval.i.c (ceval): Move declarations before statements. * libguile/read.c (scm_read_extended_symbol): Likewise. * libguile/struct.c (scm_make_struct_layout): Likewise. * libguile/threads.c (fat_mutex_unlock): Likewise. * libguile/vm-i-system.c (br_if_nargs_ne, br_if_nargs_lt): Likewise. * libguile/vm.c (make_vm): Likewise.
2009-11-15remove support for "entities" -- a form of applicable structAndy Wingo1-1/+1
Entities were meant to be a form of applicable struct. Unfortunately, the implementation is intertwingled with generics. Removing them, for now, will make it possible to cleanly re-add applicable struct support. * libguile/struct.h (SCM_STRUCTF_ENTITY): Remove. (SCM_STRUCTF_GOOPS_HACK): New flag; sigh. * libguile/struct.c (scm_make_struct): We make "entity" structs if the GOOPS_HACK flag is set. This will be fixed when we rework flags and remove hidden words. * libguile/goops.c (scm_class_of): Structs are not applicable, for now at least. (scm_sys_inherit_magic_x, scm_basic_basic_make_class) (scm_sys_allocate_instance, scm_sys_set_object_setter_x): (make_struct_class): Adapt for no more entities (and thus no entity flag). (create_standard_classes): For some reason, generic functions were getting the LIGHT flag set, after the ENTITY flag was removed; so for now explicitly clear that flag. * libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New macros. * libguile/objects.h: * libguile/objects.c: Remove code for entities. * libguile/debug.c: (scm_procedure_source): Only work with generics. * libguile/eval.c (scm_trampoline_0, scm_trampoline_1) (scm_trampoline_2): Only handle generics. * libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities. * libguile/procprop.c (scm_i_procedure_arity): Remove support for entities. * libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove entity support.
2009-10-20Use proper types for hash/assoc functions in `hashtab.h'.Ludovic Courtès1-2/+2
Partly fixes bug #23681 ("Function declarators with empty parentheses should not be used"). * libguile/goops.c (scm_wrap_component): Cast `scm_sloppy_assq'. * libguile/hashtab.c (scm_hash_fn_get_handle): Update to take functions of type `scm_t_hash_fn' and `scm_t_assoc_fn'. Update callers. (scm_ihashx): Change to match `scm_t_hash_fn'. (scm_sloppy_assx): Change to match `scm_t_assoc_fn'. * libguile/hashtab.h (scm_t_hash_fn, scm_t_assoc_fn): New types. (scm_t_hashtable)[hash_fn]: Change to `scm_t_hash_fn'. (scm_i_rehash, scm_hash_fn_get_handle, scm_hash_fn_create_handle_x, scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Change to take `scm_t_hash_fn' and `scm_t_assoc_fn' parameters. * libguile/srcprop.h (scm_whash_get_handle, scm_whash_create_handle, scm_whash_lookup): Implement in terms of `scm_hashq_*' instead of `scm_hash_fn_*'. * libguile/struct.c (scm_struct_ihashq): Change to match `scm_t_hash_fn'. (scm_struct_create_handle): Cast `scm_sloppy_assq'. * libguile/struct.h (scm_struct_ihashq): Update, make internal.
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-08-28Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-39/+37
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-25Remove the `scm_tc_free_cell' SMOB type.Ludovic Courtès1-2/+2
* libguile/deprecated.h (SCM_FREEP, SCM_NFREEP): Changed to constants. * libguile/gc.c (scm_i_tag_name): Remove reference to `scm_tc_free_cell'. * libguile/gc.h (SCM_FREE_CELL_CDR, SCM_SET_FREE_CELL_CDR): Remove. * libguile/smob.c (free_print): Remove. (scm_smob_prehistory): Don't create the "free" SMOB type. * libguile/struct.c (struct_finalizer_trampoline): Use a bare `scm_tc3_struct' tag for finalized structs instead of `scm_tc_free_cell'. * libguile/tags.h (scm_tc_free_cell): Remove.
2009-08-23Use string and symbol accessors in struct, throw, and array funcsMichael Gran1-39/+37
* libguile/struct.c (scm_make_struct_layout, scm_struct_init) (scm_struct_vtable_p, scm_struct_ref, scm_struct_set_x): use string and symbol accessors and avoid unpacking strings and symbols * libguile/throw.c (scm_ithrow): allow wide symbols in the error message * libguile/unif.c (scm_enclose_array, scm_istr2bve): use string accessors and avoid unpacking strings
2009-08-18Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-6/+7
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-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/* )
2008-12-14Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-11/+8
Conflicts: lib/Makefile.am libguile/struct.c libguile/threads.c m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-11-30Fix potential deadlock in `make-struct'.Ludovic Courtès1-10/+8
* libguile/struct.c (scm_make_struct): Remove critical section, as suggested by Linas Vepstas <linasvepstas@gmail.com>. See http://lists.gnu.org/archive/html/bug-guile/2008-11/msg00036.html for a discussion.
2008-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-1/+1
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/+1
2008-09-10Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-3/+11
Conflicts: libguile/Makefile.am libguile/coop-defs.h libguile/gc-card.c libguile/gc-freelist.c libguile/gc-malloc.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/hashtab.c libguile/hashtab.h libguile/inline.h libguile/private-gc.h libguile/struct.c libguile/struct.h libguile/threads.c libguile/threads.h libguile/vectors.h libguile/weaks.h test-suite/tests/gc.test
2008-09-10Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into ↵Ludovic Courtès1-2/+58
boehm-demers-weiser-gc Conflicts: libguile/struct.c
2008-09-10Merge commit '032913739218c756f673bfb9c8f66ef9f8f02330' into ↵Ludovic Courtès1-2/+7
boehm-demers-weiser-gc Conflicts: libguile/gc.c libguile/srcprop.c libguile/srcprop.h
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-10Turn "all interior pointers" off (slight performance gain).Ludovic Courtes1-0/+6
* libguile/gc.c (scm_storage_prehistory): Set `GC_all_interior_pointers' to 0. Register `scm_tc3_cons' and `scm_tc3_closure' as valid displacements. * libguile/struct.c (scm_alloc_struct): Register additional displacements. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-48
2008-09-10Removed the now-useless `scm_struct_free_*' functions.Ludovic Courtes1-31/+1
* 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
2008-09-05Added support for the free function of structures.Ludovic Courtes1-69/+58
* 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
2008-09-05Merge from lcourtes@laas.fr--2005-mobileLudovic Courtes1-0/+7
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
2008-08-16Use word_2 to store mark bits for freeing structs and vtables in theHan-Wen Nienhuys1-5/+5
correct order. This ensures that we only use GC Marks during the actual GC Mark.