Age | Commit message (Collapse) | Author | Files | Lines |
|
* module/ice-9/weak-vector.scm: New implementation, same interface.
* doc/ref/api-memory.texi (Weak vectors): Default weak vector value was
documented as empty list when it was actually unspecified, but #f is
most useful, so we change documentation and code to match.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(DOT_X_FILES):
(DOT_DOC_FILES):
(noinst_HEADERS):
(modinclude_HEADERS):
* libguile.h:
* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/init.c:
* libguile/weak-vector.c:
* libguile/weak-vector.h: Remove C weak vector implementation, replaced
with deprecation stubs that call out to Scheme.
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-list.h: Remove unused internal header.
* libguile/eq.c:
* libguile/evalext.c:
* libguile/goops.c:
* libguile/hash.c:
* libguile/scm.h:
* module/system/base/types.scm:
* module/system/base/types/internal.scm:
* module/system/vm/assembler.scm: Remove wvect tc7.
|
|
* module/ice-9/ephemerons.scm:
* libguile/ephemerons.c:
* libguile/ephemerons.h:
* test-suite/tests/ephemerons.test: New files.
* am/bootstrap.am (SOURCES):
* test-suite/Makefile.am (SCM_TESTS):
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(DOT_X_FILES, DOT_DOC_FILES, noinst_HEADERS): Wire ephemerons into build.
* libguile/scm.h (scm_tc7_ephemeron): New tc7.
* module/oop/goops.scm (<ephemeron>):
* module/system/base/types/internal.scm (heap-tags):
* module/system/vm/assembler.scm (system):
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of):
* libguile/init.c (scm_i_init_guile):
* libguile/print.c (iprin1): Add cases for new tc7.
|
|
|
|
Also, shunt them off to a module, and deprecate the C interface.
* module/ice-9/guardians.scm: New file.
* am/bootstrap.am (SOURCES): Add new file.
* libguile.h: Remove guardians.h include.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(DOT_X_FILES):
(DOT_DOC_FILES):
(modinclude_HEADERS): Remove guardians.[ch] files.
* libguile/init.c (scm_i_init_guile): Remove guardians.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_guardian): Deprecate.
* module/ice-9/deprecated.scm: Add make-guardian shim.
* module/oop/goops.scm (<guardian>): Remove class; they no longer have a
tc16.
* module/ice-9/popen.scm: Add guardians module.
* test-suite/tests/eval.test:
* test-suite/tests/fluids.test:
* test-suite/tests/gc.test:
* test-suite/tests/guardians.test:
* test-suite/tests/threads.test:
* test-suite/tests/types.test: Use the guardians module.
|
|
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Always
redirect to scm_gc_malloc{,_pointerless}. Don't include bdw-gc.h.
* libguile/gc-malloc.c (scm_realloc): Use Whippet gc_collect API.
* libguile/loader.c:
* libguile/scmsigs.c:
* libguile/weak-vector.c: Include bdw-gc.
|
|
* libguile/pairs.c (scm_to_ref): Copy this stub around again; we should
fix this...
(scm_is_mutable_pair): Use gc_heap_contains.
|
|
|
|
* libguile/gc.c (gc): Use Guile finalization API, not BDW.
* libguile/threads.c (guilify_self_2): Don't finalize here.
|
|
Prevents a problem where with-exception-handler isn't defined yet by the
time the first finalizer gets kicked off (it's a file port, probably one
that is closed already...)
* libguile/finalizers.h:
* libguile/init.c (scm_i_init_guile):
* libguile/finalizers.c (queue_finalizer_async): Mark maybe-unused.
(scm_init_finalizers): Rework to only enable notification when Guile is
finished initializing.
|
|
* libguile/finalizers.c (ref_to_scm, scm_to_ref): New helpers.
(add_finalizer): New helper; returns the finalizer object.
(add_builtin_finalizer): New helper for structs, smobs, ports.
(scm_i_add_struct_finalizer):
(scm_i_add_smob_finalizer):
(scm_i_add_port_finalizer):
(scm_i_add_pointer_finalizer):
(scm_i_add_finalizer): Use new helpers.
(scm_i_add_guardian_finalizer): New helper.
(run_finalizer, run_finalizers, scm_run_finalizers): Reimplement.
(%add-finalizer!): Use new helpers.
(queue_finalizer_async):
(notify_finalizers_to_run):
(start_finalization_thread):
(spawn_finalizer_thread):
(scm_i_finalizer_pre_fork):
(scm_set_automatic_finalization_enabled):
(scm_init_finalizers):
(scm_init_finalizer_thread): Use Whippet API.
* libguile/finalizers.h (scm_i_set_finalizer, scm_i_add_resuscitator):
Remove.
|
|
Instead of storing keep-alive edges in weak tables, just add extra
fields on pointer objects.
* libguile/foreign.c (make_pointer, pointer_extra_word_count)
(set_pointer_extra_word, make_pointer_0, make_pointer_1, make_pointer_3)
(attach_finalizer): New helpers.
(scm_make_pointer): Never attach finalizers on the null pointer object.
(scm_from_pointer): Likewise.
(scm_bytevector_to_pointer, scm_procedure_to_pointer): Store keep-alive
links in extra words.
(scm_init_foreign, scm_register_foreign): Rework init for null, free,
and ffi_closure_free pointers.
|
|
* libguile/finalizers.h:
* libguile/finalizers.c (pointer_finalizer_trampoline)
(scm_i_add_pointer_finalizer): New helpers.
* libguile/foreign.c (scm_i_finalize_pointer, scm_from_pointer)
(scm_set_pointer_finalizer_x): Use new API.
|
|
* libguile/finalizers.h:
* libguile/finalizers.c (port_finalizer_trampoline):
(scm_i_add_port_finalizer): New functions.
* libguile/ports.c (scm_i_finalize_port): New helper.
(scm_c_make_port_with_encoding):
(prepare_iconv_descriptors): Call scm_i_add_port_finalizer.
|
|
Whippet will need this.
* libguile/scm.h (scm_tc7_finalizer): Reserve.
* libguile/evalext.c (scm_self_evaluating_p): Add finalizer case.
* libguile/print.c (iprin1):
* libguile/finalizers.h:
* libguile/finalizers.c (scm_i_print_finalizer): Arrange to print
finalizers.
* module/oop/goops.scm (<finalizer>):
* libguile/goops.c (class_finalizer, scm_class_of)
(scm_sys_goops_early_init): Wire up support for <finalizer>.
* module/system/base/types/internal.scm (heap-tags): Add finalizers.
* module/system/vm/assembler.scm (system): Add emit-finalizer?.
|
|
* libguile/finalizers.h:
* libguile/finalizers.c (scm_i_add_struct_finalizer):
(scm_i_add_smob_finalizer): New internal API.
* libguile/smob.c (scm_i_new_smob):
(scm_i_new_double_smob):
* libguile/struct.c (scm_i_alloc_struct): Use it.
|
|
* libguile/finalizers.h:
* libguile/finalizers.c (async_gc_finalizer):
(scm_i_register_async_gc_callback): Remove.
|
|
This will replace an internal interface in (system foreign-objects).
* module/system/finalizers.scm: New file.
* am/bootstrap.am (SOURCES): Add new file.
* libguile/foreign-object.h:
* libguile/foreign-object.c (invoke_finalizer):
(sys_add_finalizer_x):
(scm_init_foreign_object):
(scm_register_foreign_object): Remove.
* libguile/init.c (scm_i_init_guile): Register finalizers instead of
foreign-object.
* module/system/foreign-object.scm (allocate-instance): Use finalizers
module.
* libguile/finalizers.c (invoke_finalizer):
(scm_sys_add_finalizer): New helper.
|
|
These tables will be implemented differently after Whippet.
* libguile/weak-set.c (do_vacuum_weak_set, vacuum_all_weak_sets):
Remove.
(scm_c_make_weak_set, scm_init_weak_set): Don't keep a table of all weak
sets.
* libguile/weak-table.c (do_vacuum_weak_table, vacuum_all_weak_tables):
Remove.
(scm_c_make_weak_table, scm_init_weak_table): No table of all tables.
|
|
* libguile/struct.h:
* libguile/struct.c (scm_i_finalize_struct): New helper.
(struct_finalizer_trampoline): Implement as shim.
|
|
* libguile/atomics-internal.h (scm_atomic_set_bits): New routine.
* libguile/smob.c (scm_i_finalize_smob): Use atomics to clear the first
word instead of the GC alloc lock.
(finalize_smob): Implement as shim.
|
|
We're on a new version series, let's remove deprecated things. Also
reduces the amount of work we need to do in adapting to a new GC,
notably for bignums.
* configure.ac (--disable-tmpnam): Remove flag, tmpnam is gone.
* doc/ref/posix.texi (File System): Remove tmpnam docs.
* libguile/bitvectors.c (scm_bitvector_to_list): Remove deprecated
branch treating arrays as bitvectors.
* libguile/deprecated.c: Remove all deprecated code. Whee!
* libguile/deprecated.h: Remove deprecated decls.
* libguile/posix.c (scm_tmpnam): Remove.
* libguile/struct.c (scm_is_valid_vtable_layout): Remove support for 'r'
fields.
* libguile/vectors.c (scm_vector_copy_partial, scm_vector_to_list)
(scm_vector_move_left_x, scm_vector_move_right_x): Remove generalized
array cases.
* test-suite/tests/vectors.test ("vector->list"): Remove shared array
test
|
|
Whippet may add a shrink interface, if it is needed.
* doc/ref/api-memory.texi (Memory Blocks): Remove some 1.8 references.
Remove discussion of scm_gc_malloc. Remove discussion of scm_gc_free.
* libguile/gc.h:
* libguile/gc-malloc.c (scm_gc_malloc): Remove.
|
|
* configure.ac: Remove --enable-debug-malloc.
* doc/ref/api-memory.texi (Memory Blocks): Remove malloc-stats mention.
* libguile/debug-malloc.c:
* libguile/debug-malloc.h: Remove.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(modinclude_HEADERS): Remove debug-malloc mentions.
* libguile/gc-malloc.c (scm_gc_register_collectable_memory):
(scm_calloc):
* libguile/init.c (scm_i_init_guile): Remove debug-malloc things.
|
|
* libguile/bytevectors.c (scm_c_shrink_bytevector): Return buf as is if
length is more than half of previous. Otherwise make a fresh buffer and
copy.
|
|
* libguile/srfi-14.c (char_ranges_insert, char_ranges_delete): New
helpers.
(scm_i_charset_set, scm_i_charset_set_range, scm_i_charset_unset): Use
the new helpers.
|
|
* libguile/srfi-14.h: Remove typo
|
|
* libguile/r6rs-ports.c (grow_byte_buffer, shrink_byte_buffer): New
helpers.
* libguile/r6rs-ports.c (bytevector_output_port_buffer_grow):
(bytevector_output_port_procedure): Use new helpers.
|
|
* libguile/gc-malloc.c (do_realloc, do_calloc): Remove.
(scm_gc_malloc): Dispatch to scm_inline_gc_malloc.
(scm_gc_calloc): Dispatch to scm_gc_malloc.
(scm_gc_realloc): Mark for removal. The issue is that the realloc'd
object should have the same kind. We could add Whippet API but it would
be nice to not do that.
|
|
* libguile/jit.c (compile_allocate_words_immediate):
(compile_allocate_words_immediate_slow):
(compile_allocate_pointerless_words_immediate):
(compile_allocate_pointerless_words_immediate_slow): Update for new API.
|
|
|
|
* libguile/gc-malloc.c: Trim set of includes.
(do_gc_malloc_atomic): Remove.
(scm_gc_malloc_pointerless): Call scm_inline_gc_malloc_pointerless.
(scm_gc_strndup): Call scm_gc_malloc_pointerless.
|
|
* libguile/gc.h:
* libguile/gc-malloc.c (do_gc_free, scm_gc_free): Remove.
|
|
* libguile/struct.c (set_vtable_access_fields): If there are no fields,
we don't need to allocate an unboxed fields array.
|
|
* libguile/i18n.c (scm_make_locale):
* libguile/random.c (scm_c_random_bignum):
* libguile/regex-posix.c (regex_free):
(scm_make_regexp):
* libguile/srfi-14.c (scm_i_charset_unset, charsets_intersection)
(charsets_complement): Remove calls to scm_gc_free.
|
|
* libguile/gc.h:
* libguile/gc.c (scm_gc_after_nonlocal_exit): Give it a scm_thread
argument, and cause GC with whippet API.
(scm_init_gc): Set alloc failure handler using Whippet API instead of
BDW.
(scm_oom_fn): Add heap argumnet.
* libguile/eval.c (eval):
* libguile/exceptions.c (scm_c_with_exception_handler):
* libguile/vm.c (scm_call_n): Adapt.
|
|
|
|
* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Move
gc-inline.h to be a private header.
* libguile/gc-inline.h (scm_inline_gc_malloc_pointerless):
(scm_inline_gc_malloc): Use gc_allocate.
* libguile/intrinsics.c (allocate_words_with_freelist):
(allocate_pointerless_words_with_freelist): Remove these intrinsics.
Renumbers the intrinsics.
(scm_bootstrap_intrinsics):
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Adapt to intrinsics
change.
* libguile/jit.c (emit_update_alloc_table):
(emit_allocate_bytes_fast_freelist):
(emit_allocate_words_slow): New helpers.
(compile_allocate_words):
(compile_allocate_words_immediate):
(compile_allocate_words_immediate_slow):
(compile_allocate_pointerless_words):
(compile_allocate_pointerless_words_immediate):
(compile_allocate_pointerless_words_immediate_slow): Use new helpers.
* libguile/threads.c (scm_trace_thread_mutator_roots):
(on_thread_exit):
* libguile/threads.h: Remove Guile-managed thread-local freelists.
|
|
Headed towards a 4.0. The binary format will change slightly but
incompatibly (e.g. renumbering of intrinsics). Having a new GC is
enough of a change to warrant a minor version bump, and it's been 5
years so why not go major.
* GUILE-VERSION (GUILE_EFFECTIVE_VERSION): Bump to 4.0.
(GUILE_MICRO_VERSION, GUILE_MINOR_VERSION): Bump to 3.9.0.
(LIBGUILE_INTERFACE_CURRENT, LIBGUILE_INTERFACE_AGE): Reset.
* meta/guile-4.0.pc.in:
* meta/guile-4.0-uninstalled.pc.in: Rename from guile-3.0.
* .gitignore: Ignore pkg-config files with 4.0 effective version.
* README: Update slightly.
* doc/ref/api-evaluation.texi (Load Paths):
* doc/ref/api-options.texi (Build Config):
* doc/ref/guile-invoke.texi (Environment Variables):
* doc/ref/history.texi (A Timeline of Selected Guile Releases):
* doc/ref/libguile-parallel.texi (Parallel Installations):
* doc/ref/srfi-modules.texi (SRFI-0): Update references to stable
version in paths.
* module/system/vm/assembler.scm (*bytecode-minor-version*):
* libguile/loader.h (SCM_OBJCODE_MAJOR_VERSION):
(SCM_OBJCODE_MINIMUM_MINOR_VERSION):
(SCM_OBJCODE_MINOR_VERSION): Use the same major objcode version for now
but bump the minor to 99.
* meta/guile.m4 (GUILE_PKG, GUILE_PROGS): Check for Guile 4.0.
* module/ice-9/boot-9.scm (%cond-expand-features): Add new cond-expand
features.
|
|
* libguile/scm.h (scm_tc7_thread): Give threads their own tc7.
* libguile/threads.h (struct scm_thread): Add a tag, so that struct
thread can be a SCM directly. Add a struct gc_mutator* member.
(scm_thread_handle): New inline function.
(SCM_I_IS_THREAD, SCM_I_THREAD_DATA, SCM_VALIDATE_THREAD): Update to use
tc7 instead of SMOB tags.
* libguile/continuations.c (scm_i_with_continuation_barrier)
* libguile/finalizers.c (queue_finalizer_async)
* libguile/jit.c (compile_current_thread)
* libguile/threads.c (block_self, guilify_self_2)
(lock_mutex, unlock_mutex, timed_wait scm_current_thread)
(scm_all_threads)
* libguile/vm-engine.c (current-thread): Use scm_thread_handle instead
of thread->handle.
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (class_thread, scm_class_of, scm_sys_goops_early_init)
* libguile/print.c (iprin1)
* module/language/cps/compile-bytecode.scm (compile-function)
* module/oop/goops.scm (<thread>)
* module/system/base/types.scm (cell->object)
* module/system/base/types/internal.scm (heap-tags)
* module/system/vm/assembler.scm: (emit-thread?): Adapt to
scm_tc7_thread.
* libguile/gc-internal.h: Move init functions that take "struct
gc_stack_addr" here, so that internal Whippet uses don't cause Whippet
to be added to public headers.
* libguile/gc.c (scm_storage_prehistory): Take struct gc_stack_addr as
arg, and pass to gc_init. Return a mutator pointer.
* libguile/init.c (scm_i_init_guile): Pass mutator and stack base to GC
and thread init routines.
* libguile/threads.c (scm_trace_dynstack, scm_trace_thread)
(scm_trace_thread_mutator_roots): New infra for marking threads in terms
of Whippet API.
* libguile/threads.c (guilify_self_1): Since we don't use a separate GC
kind for threads any more, and thread marking is keyed off
gc_mutator_set_roots, we can avoid some of the gnarly synchronization.
(on_thread_exit): Arrange to gc_finish_for_thread.
(scm_i_init_thread_for_guile): Use gc_init_for_thread.
(init_main_thread, with_guile, scm_i_with_guile): Use Whippet API.
(scm_threads_prehistory): Take main-thread mutator and the stack base as
arguments.
* libguile/vm.c (scm_trace_vm): Rework in terms of Whippet API.
* libguile/whippet-embedder.h (gc_trace_mutator_roots): Arrange to trace
the current mutator's SCM thread object.
* libguile/trace.h: New file, to declare implementations of trace
routines.
* libguile/Makefile.am (noinst_HEADERS): Add trace.h.
|
|
|
|
* libguile/gc.c (scm_storage_prehistory): Adapt to new gc_init
prototype.
|
|
|
|
* libguile/gc.c: Define an event listener that collects basic
statistics, runs C hooks, and arranges to run the Scheme hook if it is
nonempty.
(scm_gc_stats): Fetch statistics from the gathered event data.
(scm_gc_dump): Use scm_basic_stats_print.
(scm_storage_prehistory): Fix indentation.
(scm_init_gc_protect_object): Remove dead code.
(queue_after_gc_hook): Not really needed, as we have an after-GC C event
to run the C hooks. Scheme hook activation is inlined into the event
listener.
(start_gc_timer, accumulate_gc_timer): No need any more.
(scm_init_gc): Simplify hook registration.
|
|
|
|
* libguile/gc.c (scm_storage_prehistory): Use Whippet API instead of
BDW-GC API.
|
|
* libguile/Makefile.am (WHIPPET_EMBEDDER_H): Define this variable
instead of using -include; otherwise we don't get the chance to set
_LARGEFILE64_SOURCE before including Whippet files.
(AM_CPPFLAGS): Simplify.
(libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES): Explicitly add
libwhippet.la as a dependency.
(noinst_HEADERS): Add gc-internal.h
* libguile/gc-internal.h: New file.
* libguile/gc.c: Include gc-internal.h.
|
|
|
|
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
Add libwhippet.la.
|
|
* configure.ac: Add subdir-objects Makefile.am option, to prevent
accidental collision between object file names.
* libguile/Makefile.am: Include whippet/embed.am, and add the
appropriate hooks to the Makefile.
* libguile/whippet-embedder.h: New file.
|
|
|