summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06enable port lockingAndy Wingo1-3/+0
* libguile/ports.c (scm_c_make_port_with_encoding): Enable port locking.
2011-12-06fix scm_adjust_port_revealed_x FUNC_NAMEAndy Wingo1-1/+1
* libguile/ports.c (scm_adjust_port_revealed_x): Fix FUNC_NAME.
2011-12-06fix asm-to-bytecode.testAndy Wingo1-4/+3
* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size) (test-target): The objcode version embedded in the cookie is not an effective version, so elide it from the test.
2011-12-06port locking refactorAndy Wingo3-73/+121
* libguile/ports.h (struct scm_t_port): Make the lock into a pointer field instead of an inline field. It should be possible to make unlocked ports by having a NULL lock field. (scm_c_lock_port, scm_c_try_lock_port): Return the mutex if the port was actually locked. (scm_c_unlock_port): Remove. * libguile/ports.c (scm_c_make_port_with_encoding): For now, leave `lock' set to 0. Change scm_c_lock_port callers to pay attention to the new API. * libguile/print.c (scm_write, scm_display): Fix call to dynwind-lock-port for ports-with-print-states.
2011-12-02Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo3-2/+44
Conflicts: libguile/guile.c libguile/numbers.c
2011-12-02install gmp memory functions that let libgc know about allocationsAndy Wingo3-3/+45
* libguile/numbers.c (custom_gmp_malloc, custom_gmp_realloc, custom_gmp_free): New static functions used by GMP for allocation. These are just wrappers for scm_malloc, scm_realloc, and free. (scm_init_numbers): If scm_install_gmp_memory_functions is nonzero, use mp_set_memory_functions to configure GMP to use custom_gmp_{malloc,realloc,free} for memory allocation. (scm_bigprint): Ask gmp for the function used to deallocate the string returned by mpz_get_str. * libguile/numbers.h: Declare scm_install_gmp_memory_functions. * libguile/guile.c: When running the Guile binary, install the gmp_memory_functions. Based on a patch by Mark H Weaver <mhw@netris.org>.
2011-12-01Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo54-9681/+10211
Conflicts: configure.ac libguile/fluids.c libguile/gc.c libguile/gc.h libguile/objcodes.c libguile/procprop.c libguile/vm.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm
2011-12-01fix deadlock in before-gc-hook on certain 7.2alpha gc versionsAndy Wingo1-1/+10
* libguile/gc.c (scm_init_gc): Only adjust gc frequency in the gc start hook if we know that it won't take a lock.
2011-11-29attempt to handle steady-state mallocations betterAndy Wingo3-1/+40
* libguile/gc-malloc.c (scm_realloc): Call the new scm_gc_register_allocation() here. If we have to collect, do a GC_gcollect_and_unmap. * libguile/gc.c (scm_gc_register_allocation): Add a routine to track steady-state mallocation, and cause gc to run if there is a high mallocation rate. (adjust_gc_frequency): Reset the bytes-until-GC countdown timer.
2011-11-29collect a little in call-with-new-threadAndy Wingo1-0/+1
* libguile/threads.c (scm_call_with_new_thread): Collect a little before making a new thread. Our adjust_gc_frequency hack doesn't work well if the main allocation load is thread creation, as in https://savannah.gnu.org/bugs/?34140. This does not appreciably affect the speed of the test in that bug, but does effectively limit the image size.
2011-11-29adjust_gc_frequency before gc, for more precisionAndy Wingo1-1/+1
* libguile/gc.c (scm_init_gc): Run the adjust_gc_frequency from the before-gc-hook, not the after-gc-hook. More precise, this way.
2011-11-29fix uninitialized variable in gc.cAndy Wingo1-1/+1
* libguile/gc.c (get_image_size): Fix use of uninitialized variable.
2011-11-29switch off debugging flag that was mistakenly left onAndy Wingo1-1/+1
* libguile/gc.c (HEURISTICS_DEBUG): Whoops, switch this off.
2011-11-29increase garbage collection rate if the process is growingAndy Wingo2-3/+149
* configure.ac: Check for GC_get_free_space_divisor. * libguile/gc.c (GC_get_free_space_divisor): Define an implementation, if needed. (accumulate_gc_timer): Fix indentation. (get_image_size): New terrible hack. Needs implementations on other platforms. (adjust_gc_frequency): Attempt to adjust the GC frequency based on process image growth. Needs more comments. (scm_init_gc): Add the adjust_gc_frequency to the after_gc_c_hook.
2011-11-28get heap stats with GC_get_heap_usage_safe, if available.Andy Wingo2-7/+21
* configure.ac: Check for GC_get_heap_usage_safe. * libguile/gc.c (SCM_DEFINE): Use GC_get_heap_usage_safe.
2011-11-26FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.Ludovic Courtès2-2/+20
* libguile/foreign.c (scm_procedure_to_pointer): Keep a weak reference to PROC. * test-suite/tests/foreign.test ("procedure->pointer")["procedure is retained"]: New test.
2011-11-24support for new GC_move_disappearing_linkAndy Wingo3-5/+35
* configure.ac: Check for GC_move_disappearing_link. * libguile/weak-set.c (move_weak_entry): * libguile/weak-table.c (move_disappearing_links): (move_weak_entry): Use GC_move_disappearing_link if available.
2011-11-24remove scm_si_name_accessAndy Wingo1-2/+1
* libguile/goops.h (scm_si_name_access): Remove alias for scm_si_getters_n_setters.
2011-11-24remove unused <class> slot: keyword-accessAndy Wingo2-6/+2
* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, scm_si_keyword_access): * libguile/goops.c (build_class_class_slots): Remove unused keyword-access slot from classes.
2011-11-24deprecate make-vtable-vtableAndy Wingo3-4/+40
* 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-24simplify %condition-type-vtableAndy Wingo1-8/+8
* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable instead of make-vtable-vtable.
2011-11-24record-type-vtable is not a new root of the vtable hierarchyAndy Wingo1-10/+7
* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use make-vtable instead of make-vtable-vtable.
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-24remove public scm_protects exportAndy Wingo2-4/+2
* libguile/gc.h: * libguile/gc.c: Remove scm_protects from the API. It is deprecated on stable-2.0.
2011-11-24no gc_register_root in scm_init_printAndy Wingo1-2/+0
* libguile/print.c (scm_init_print): No need to gc_register_root here.
2011-11-24remove object protection from options.cAndy Wingo1-26/+10
* libguile/options.c (change_option_setting, scm_init_options): Rely on the options being allocated in GC-able memory, as in static memory. Therefore there is no need for the gc-protect dance.
2011-11-24simplify scm_init_printAndy Wingo1-5/+3
* libguile/print.c (scm_init_print): Simplify creation of print-state vtable.
2011-11-23web-http.test validates headersDaniel Hartwig1-2/+3
* test-suite/tests/web-http.test (pass-if-parse): Validate header values as well.
2011-11-23fix validators for various list-style headersDaniel Hartwig1-8/+18
* module/web/http.scm (default-val-validator): Valid with no value. (key-value-list?): Keys are always symbols, do not accept strings. (validate-param-list): Apply `valid?' to list elements. (validate-credentials): Validate param for Basic scheme, which is parsed as a string. (declare-symbol-list-header!): `list-of?' args were in wrong order. ("Cache-Control"): Replace `default-val-validator' with more specific procedure. ("Accept"): Validate on first param which has no value.
2011-11-23Update cross-compilation instructions.Ludovic Courtès1-10/+13
* README (Cross building Guile): Update.
2011-11-23configure: Make sure $GUILE_FOR_BUILD is suitable.Ludovic Courtès2-14/+51
* acinclude.m4 (GUILE_CHECK_VERSION, GUILE_CHECK_GUILE_FOR_BUILD): New macros. * configure.ac: Remove $GUILE_FOR_BUILD tests. Use `GUILE_CHECK_GUILE_FOR_BUILD'.
2011-11-23Allow $GUILE_FOR_BUILD to use its own environment when cross-compiling.Ludovic Courtès3-44/+55
* am/guilec (.scm.go): Use `-L' to specify the search path. * module/Makefile.am (ice-9/psyntax-pp.go): Likewise. * meta/uninstalled-env.in (top_builddir): Leave $GUILE_LOAD_PATH, $GUILE_SYSTEM_PATH, and $GUILE_SYSTEM_EXTENSIONS_PATH unchanged when cross-compiling.
2011-11-23Use default value for make-fluid in Scheme filesAndy Wingo10-86/+65
* module/ice-9/boot-9.scm (%exception-handler) (%running-exception-handlers, read-eval?, *repl-stack*) (make-mutable-parameter): * module/ice-9/getopt-long.scm (%program-name): * module/language/elisp/runtime.scm (built-in-macro, defspecial): * module/srfi/srfi-39.scm (make-parameter/helper): * module/system/base/language.scm (*current-language*): * module/system/base/message.scm (*current-warning-port*): (*current-warning-prefix*): * module/system/base/target.scm (%target-type, %target-endianness) (%target-word-size): * module/texinfo/plain-text.scm (*indent*, *itemizer*): * benchmark-suite/lib.scm (prefix-fluid): * test-suite/lib.scm (prefix-fluid): Give fluids a useful default value.
2011-11-23use new scm_make_fluid_with_defaultAndy Wingo3-9/+7
* libguile/load.c (scm_init_load): * libguile/ports.c (scm_init_ports): * libguile/read.c (scm_init_read): Use scm_make_fluid_with_default.
2011-11-23optional default-value arg to make-fluidAndy Wingo6-23/+37
* libguile/fluids.c (grow_dynamic_state, new_fluid): Arrange for the default value in the dynamic-state vector to be SCM_UNDEFINED instead of SCM_BOOL_F. If the value in the dynamic-state is #f, default to a value attached to the fluid instead. This allows useful default values. (scm_make_fluid_with_default): New function, allows the user to specify a default value for the fluid. Defaults to #f. Bound to `make-fluid' on the Scheme side. (scm_make_unbound_fluid): Use SCM_UNDEFINED as the default in all threads. (scm_fluid_unset_x): Also unset the default value. Not sure if this is the right thing. (fluid_ref): Update to the new default-value strategy. * libguile/threads.c (scm_i_reset_fluid): Reset to SCM_UNDEFINED. * libguile/threads.h: Remove extra arg to scm_i_reset_fluid. * libguile/vm-i-system.c (fluid-ref): Update to new default-value strategy. * module/ice-9/vlist.scm (block-growth-factor): Default to 2 in all threads. Fixes http://debbugs.gnu.org/10093.
2011-11-22Install the current locale when Guile is invoked directly.Ludovic Courtès1-2/+12
* libguile/guile.c (main): Add `setlocale' call.
2011-11-22Add Gnulib `largefile' module.Ludovic Courtès1-1/+2
It will really be added next time we run "gnulib-tool --update".
2011-11-22Leave $GUILE_LOAD_COMPILED_PATH unchanged when cross-compiling.Ludovic Courtès1-14/+19
* meta/uninstalled-env.in: Don't define $GUILE_LOAD_COMPILED_PATH when cross-compiling.
2011-11-22Build `psyntax-pp.go' with `--target=$(host)'.Ludovic Courtès1-3/+4
* module/Makefile.am (ice-9/psyntax-pp.go): Pass `--target=$(host)'.
2011-11-22Run `guild compile' with `--target=$(host)'.Ludovic Courtès1-1/+1
* am/guilec (.scm.go): Run `guild compile' with `--target=$(host)'.
2011-11-22Add a `--target' option to `guild compile'.Ludovic Courtès2-7/+24
* module/scripts/compile.scm (%options)["--target"]: New option. (show-version): Update copyright year. (compile): Use `with-target' to install the target. * doc/ref/api-evaluation.texi (Compilation): Mention `--target' option.
2011-11-22Add missing implicit `SCM_API' for `scm_c_make_objcode_slice'.Ludovic Courtès1-1/+1
* libguile/objcodes.h (scm_c_make_objcode_slice): Add implicit `SCM_API'.
2011-11-22Complete cross-compilation support.Ludovic Courtès5-51/+228
* module/system/base/target.scm (%target-endianness, %target-word-size): New fluids. (%native-word-size): New variable. (with-target): Set these fluids. (cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor, triplet-os): New procedures. (target-cpu, target-vendor, target-os): Use them. (target-endianness, target-word-size): Refer to the corresponding fluid. * libguile/objcodes.c (target_endianness_var, target_word_size_var): New global variables. (NATIVE_ENDIANNESS): New macro. (target_endianness, target_word_size, to_native_order): New functions. (make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. (bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode', with the addition of an `endianness' and `word_size' parameters. (scm_bytecode_to_objcode): Use it. (scm_bytecode_to_native_objcode): New function. (scm_write_objcode): Use `target_word_size' and `target_endianness'. Convert OBJCODE's len and meta-len to native byte order. (scm_init_objcodes): Initialize `target_endianness_var' and `target_word_size_var'. * libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration. * libguile/vm.c (really_make_boot_program): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. * test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New variable. (test-target): New procedure. ("cross-compilation"): Add `test-target' calls and the "unknown target" test.
2011-11-22Fix `validate-target' in (system base target).Ludovic Courtès2-3/+26
* module/system/base/target.scm (validate-target): Accept any tuple with at least 3 parts. * test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure. ("cross-compilation"): New test prefix.
2011-11-21deprecate direct scm_protects accessAndy Wingo2-3/+8
* libguile/gc.h: * libguile/gc.c: Deprecate direct access to scm_protects.
2011-11-20Allow overlapping regions to be passed to `bytevector-copy!'.Ludovic Courtès3-6/+14
Reported by Dmitry Chestnykh <dmitry@codingrobots.com>. Fixes <http://debbugs.gnu.org/10070>. * libguile/bytevectors.c (scm_bytevector_copy_x): Use `memmove', not `memcpy'. * test-suite/tests/bytevectors.test ("2.2 General Operations")["bytevector-copy! overlapping"]: New test. * doc/ref/api-data.texi (Bytevector Manipulation): Mention possible overlapping.
2011-11-17eval.test workAndy Wingo1-71/+43
* test-suite/tests/eval.test ("stacks"): Enable another test, fix to use with-throw-handler, and remove a duplicate test, now that there is no difference between subrs and gsubrs.
2011-11-16FFI: Hold a weak reference to the CIF made by `procedure->pointer'.Ludovic Courtès1-3/+11
* libguile/foreign.c (scm_procedure_to_pointer): Keep a weak reference to CIF so that it is not reclaimed before POINTER. Before that it could be reclaimed and typically reused to store the CIF of another procedure with the same arity, leading to obscure wrong-type-arg errors.
2011-11-16FFI: Add a `procedure->pointer' test.Ludovic Courtès1-0/+10
* test-suite/tests/foreign.test ("procedure->pointer")["procedures returning a pointer"]: New test.