1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-01 23:30:28 +02:00
Commit graph

6 commits

Author SHA1 Message Date
Andy Wingo
a7801c750f vm: BUILDING_LIBGUILE-guarded defs to internal headers
Also make "struct scm_vm" private, now that scm_thread is also private.

* libguile/vm-internal.h: New file.
* libguile/Makefile.am: Add new file.
* libguile/continuations.c:
* libguile/debug.c:
* libguile/frames.c:
* libguile/init.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/script.c:
* libguile/stacks.c:
* libguile/threads-internal.h:
* libguile/threads.c:
* libguile/threads.h:
* libguile/throw.c:
* libguile/vm.c: Include new file.
* libguile/vm.h: Remove private defs.
2025-07-01 11:04:57 +02:00
Andy Wingo
823df42d0c Move scm_cond, scm_mutex definitions to internal header
* libguile/threads.c
* libguile/threads-internal.h: As it says on the tin!
2025-06-30 16:03:25 +02:00
Andy Wingo
985c1d16f2 Make dynstack interface completely internal
* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Don't
install dynstack.h.
* libguile/dynwind.c (translate_frame_flags, scm_dynwind_begin)
(translate_winder_flags, scm_dynwind_unwind_handler):
* libguile/dynwind.h (scm_t_dynwind_flags, scm_t_wind_flags): Instead of
punning the dynwind.h flags to dynstack.h values, translate them.
* libguile/threads-internal.h:
* libguile/threads.h: Include dynstack.h in the private header.
2025-06-30 14:07:05 +02:00
Andy Wingo
8b2b0d52d8 Remove "result" member from struct scm_thread
* libguile/threads-internal.h:
* libguile/threads.c (scm_trace_thread, guilify_self_1, really_launch):
Remove "result".  Replaced by join_results.
2025-06-30 09:56:20 +02:00
Andy Wingo
b0ce014801 Inline thread wakeup data into "struct scm_thread"
This way we don't allocate an untagged wake data, and we don't need a
type tag.  On the other hand we have to roll a more complicated seqlock,
but that's fine.

Also switch to require C11 atomics.

* libguile/atomics-internal.h: Remove fallback for when we don't have
C11 atomics.
(scm_atomic_ref_uint32, scm_atomic_swap_uint32, scm_atomic_set_uint32):
New helpers.
* libguile/threads-internal.h:
* libguile/async.h:
* libguile/async.c: Inline the thread wake data.  Happily, waking a
remote thread is still wait-free from both sides.
2025-06-25 16:00:07 +02:00
Andy Wingo
552960b3e2 Move struct scm_thread definition to private header
Allows us to inline the "struct scm_dynamic_state", avoiding an untagged
traced allocation.

* libguile/threads-internal.h: New file.
* libguile/Makefile.am (noinst_HEADERS): Add new file.

Adapt all users, notably of SCM_I_CURRENT_THREAD and scm_i_misc_mutex.
2025-06-25 12:55:18 +02:00