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

9761 commits

Author SHA1 Message Date
Andy Wingo
c79d5bd0f7 Change to be less sloppy as regards functions without prototypes
* libguile/gsubr.h (scm_t_subr_0, scm_t_subr_1, etc): New precise
typedefs.
(SCM_AS_SUBR): Use C11's _Generic to cast subrs to the generic subr
type, while also producing a warning/error if the function isn't
compatible.
(SCM_DEFINE_GSUBR, SCM_PRIMITIVE_GENERIC, SCM_DEFINE_PUBLIC)
(SCM_DEFINE_STATIC, SCM_PROC, SCM_REGISTER_PROC, SCM_GPROC): Use
SCM_AS_SUBR.
* libguile/gsubr-internal.h (scm_t_subr_with_thread_0)
(scm_t_subr_with_thread_1, etc): New precise typedefs.
(SCM_AS_SUBR_WITH_THREAD): Like SCM_AS_SUBR.
* libguile/gsubr.c (scm_apply_subr): Cast callee to the right type
before calling.
* libguile/hash.c (floor): Remove weird unused declaration.
* libguile/init.c (scm_boot_guile): Fix type of main_func in definition.
* libguile/jit.c: Fix type of enter_mcode.
* libguile/smob.c (apply_0, apply_1, apply_2, apply_3): Cast callee to
right type.
(scm_smob_trampoline): Use SCM_AS_SUBR.
* libguile/smob.h (SCM_SMOB_APPLY): Use SCM_AS_SUBR.
* libguile/backtrace.c:
* libguile/control.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/exceptions.c:
* libguile/expand.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gc.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/rdelim.c:
* libguile/rw.c:
* libguile/vm.c: Adapt scm_c_make_gsubr / scm_c_define_gsubr callers to
use SCM_AS_SUBR.
2025-06-26 15:56:16 +02:00
Andy Wingo
a7d7ff5019 scm_gc_object_address pins its referent
* libguile/gc.h:
* libguile/gc.c (scm_gc_pin_object): New function.
(scm_gc_object_address): New function, to be used instead of SCM_UNPACK
when an object's address is exposed, for example via hashq.
* libguile/atomic.c:
* libguile/cache-internal.h:
* libguile/continuations.c:
* libguile/dynstack.c:
* libguile/dynstack.h:
* libguile/ephemerons.c:
* libguile/exceptions.c:
* libguile/finalizers.c:
* libguile/fluids-internal.h:
* libguile/fluids.c:
* libguile/foreign.c:
* libguile/frames.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/intrinsics.c:
* libguile/memoize.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/smob.c:
* libguile/struct.c:
* libguile/struct.h:
* libguile/variable.c:
* libguile/vm.c: Use the new functions everywhere that is needed.
Because they take a thread, sometimes we have to do some extra plumbing.
2025-06-26 15:00:22 +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
7d1eda149e Manage pre-goops port type list using pairs
Avoids sloppy allocations.

* libguile/ports-internal.h (scm_is_port_type):
(scm_to_port_type, scm_from_port_type): New helpers.
* libguile/goops.c (scm_make_port_classes):
(create_port_classes): Use a list and be thread-safe.
2025-06-25 12:55:18 +02:00
Andy Wingo
9e9567b22a Port type objects are tagged
* libguile/scm.h (scm_tc7_port_type):
* libguile/ports-internal.h (struct scm_t_port_type):
* libguile/ports.c (scm_make_port_type): These objects have been
allocated pointerless since 2011, but since 2016 at least they have had
SCM members.  Oops!
2025-06-25 12:55:18 +02:00
Andy Wingo
1520a5e425 Convert thread launch data to be vector
Before, it was untagged, which is a problem for precise tracing.

* libguile/threads.c (make_launch_data, protect_launch_data)
(unprotect_launch_data, really_launch, launch_thread)
(scm_sys_call_with_new_thread): Use a vector for launch data.
2025-06-25 12:55:18 +02:00
Andy Wingo
5fe6bc9d66 Remove unused scm_make_cache
* libguile/cache-internal.h (scm_make_cache): Remove.
2025-06-25 12:55:18 +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
Andy Wingo
a6b848dcba Deprecate C hooks
* libguile/chooks.c:
* libguile/chooks.h: Remove.
* libguile/deprecated.h:
* libguile/deprecated.c: Add deprecated implementations.
* libguile/gc.c:
* libguile/gc.h: Arrange to call before/after C hooks if deprecated code
is enabled.
* libguile/Makefile.am:
* libguile.h: Remove chooks.[ch] references.
2025-06-25 12:55:18 +02:00
Andy Wingo
08296e6022 Remove last vestiges of ia64 support
* configure.ac:
* libguile/continuations-internal.h (struct scm_continuation):
* libguile/continuations.c (capture_auxiliary_stack)
(restore_auxiliary_stack, scm_i_make_continuation, copy_stack_and_call):
* libguile/gen-scmconfig.c (main):
* libguile/threads.h (struct scm_thread): Remove support for aux stacks.
2025-06-25 12:55:18 +02:00
Andy Wingo
4b2924730e Excise scm_words from struct.c
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Update for unboxed-fields
representation change.
* libguile/struct.c (scm_i_alloc_struct, scm_make_struct_simple): Use
scm_allocate_tagged.
2025-06-25 12:55:18 +02:00
Andy Wingo
91ba12f444 Fix vtable base layout
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Update for unboxed-fields
representation change.
* module/oop/goops.scm (fold-class-slots): Likewise.
2025-06-25 12:55:12 +02:00
Andy Wingo
bd1e5ff688 Switch unboxed-fields bitmask to be a Scheme integer
Requires a full rebuild!!

* libguile/struct.h (SCM_VTABLE_UNBOXED_FIELDS):
(SCM_VTABLE_FIELD_IS_UNBOXED): Use logbit? to determine if a field is
unboxed.
* module/language/cps/guile-vm/lower-primcalls.scm
(vtable-has-unboxed-fields?): Just check against SCM_INUM0.
(vtable-field-boxed?): Likewise, the bitmask is an integer.
* libguile/struct.c (set_vtable_access_fields): Set UNBOXED_FIELDS
bitmask as integer.
2025-06-24 15:05:28 +02:00
Andy Wingo
1c092eb413 Give structs a "struct scm_struct"
* libguile/modules.h (SCM_MODULE_OBARRAY):
(SCM_MODULE_USES):
(SCM_MODULE_BINDER):
(SCM_MODULE_EVAL_CLOSURE):
(SCM_MODULE_TRANSFORMER):
(SCM_MODULE_DUPLICATE_HANDLERS):
(SCM_MODULE_IMPORT_OBARRAY): Use SCM_STRUCT_SLOT_REF instead of
SCM_STRUCT_SLOTS.
* libguile/struct.h (scm_is_struct):
(scm_to_struct):
(scm_from_struct):
(scm_i_struct_vtable):
(scm_i_struct_ref_scm):
(scm_i_struct_set_scm):
(scm_i_struct_ref_raw):
(scm_i_struct_set_raw): New helpers.
(SCM_STRUCTP):
(SCM_STRUCT_SLOT_REF):
(SCM_STRUCT_SLOT_SET):
(SCM_STRUCT_DATA_REF):
(SCM_STRUCT_DATA_SET): Use new helpers.
(SCM_STRUCT_DATA):
(SCM_STRUCT_SLOTS): Remove.
(SCM_SET_VTABLE_FLAGS): Fix for SCM_STRUCT_SLOT_REF not being lvalue.
2025-06-24 13:58:14 +02:00
Andy Wingo
c2f451bf57 Remove unused internal inline allocation functions
* libguile/gc-inline.h (scm_inline_cell, scm_inline_double_cell)
(scm_inline_words, scm_inline_gc_malloc_pointerless, scm_inline_gc_malloc)
(scm_inline_gc_malloc_words, scm_inline_gc_malloc_pointerless_words):
Remove.
2025-06-24 11:41:49 +02:00
Andy Wingo
5d9d84b68e Remove internal scm_inline_cons
* libguile/gc-inline.h (scm_inline_cons): Remove.
* libguile/vm.c (cons): Inline use.
2025-06-24 11:37:50 +02:00
Andy Wingo
a478665ab6 Move vectors off scm_words
Also move most internal vector representation into a private header
file.

* libguile/vectors-internal.h: New file.
* libguile/vectors.h (SCM_I_IS_MUTABLE_VECTOR, SCM_I_VECTOR_WELTS)
(SCM_I_VECTOR_ELTS, SCM_I_VECTOR_LENGTH): Remove these internal
definitions.
* libguile/vectors.c: Adapt to use new data types.
* libguile/eval.c: Include internal file.
* libguile/init.c: Include internal file.
* libguile/array-handle.c (scm_array_get_handle): Use new functions.
2025-06-24 11:20:38 +02:00
Andy Wingo
7dfbb8bc4b Inline scm_is_vector
* libguile/vectors.h (scm_is_vector): Define inline.
(SCM_I_IS_VECTOR): Remove.
* libguile/eval.c (env_tail): Use scm_is_vector.
* libguile/vectors.c (scm_is_vector): Remove.
2025-06-24 10:54:22 +02:00
Andy Wingo
05e868892b Deprecate SCM_SIMPLE_VECTOR_REF et al
* libguile/vectors.h:
* libguile/deprecated.c:
* libguile/deprecated.h (SCM_SIMPLE_VECTOR_LENGTH):
(SCM_SIMPLE_VECTOR_REF):
(SCM_SIMPLE_VECTOR_SET): Deprecate.
2025-06-24 10:52:31 +02:00
Andy Wingo
da51198ce8 Fix a couple SCM_SIMPLE_VECTOR stragglers
* libguile/filesys.c (retrieve_select_type):
* libguile/hashtab.c (rehash):
* libguile/posix.c (scm_uname):
* libguile/vectors.c (scm_c_vector_set_x):
(scm_c_make_vector): Fix some SCM_SIMPLE_VECTOR users.
2025-06-24 10:52:27 +02:00
Andy Wingo
617344f822 Switch all users of SCM_SIMPLE_VECTOR_SET to scm_c_vector_set_x
* libguile/eval.c:
* libguile/filesys.c:
* libguile/hashtab.c:
* libguile/memoize.c:
* libguile/net_db.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/regex-posix.c:
* libguile/scmsigs.c:
* libguile/socket.c:
* libguile/stime.c:
* libguile/strports.c: Use C function instead of macro.
2025-06-24 10:40:40 +02:00
Andy Wingo
4dedc48cfb Switch all users of SCM_SIMPLE_VECTOR_REF to scm_c_vector_ref
* libguile/arrays.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/hashtab.c:
* libguile/intrinsics.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/poll.c:
* libguile/ports-internal.h:
* libguile/posix.c:
* libguile/print.c:
* libguile/scmsigs.c:
* libguile/socket.c:
* libguile/stime.c:
* libguile/strports.c:
* libguile/vectors.c: Use C function instead of macro.
2025-06-24 10:32:14 +02:00
Andy Wingo
d73c675fa6 Switch all users of SCM_SIMPLE_VECTOR_LENGTH to scm_c_vector_length
* libguile/arrays.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/poll.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/socket.c:
* libguile/stime.c: Use C function instead of macro.
2025-06-24 09:59:24 +02:00
Andy Wingo
0a5d2ffb1a Move foreign pointers off scm_words
* libguile/foreign.h: Give pointers a struct type.  Adapt to use it
internally.
* libguile/foreign.c: Allocate pointers with scm_allocate_tagged.
2025-06-24 09:27:44 +02:00
Andy Wingo
61af4d201a Syntax uses scm_allocate_tagged
* libguile/syntax.c: Define a "struct scm_syntax".  Use it instead of
scm_words and SCM_CELL_OBJECT.
2025-06-23 21:06:31 +02:00
Andy Wingo
a5f9d0da6a Vm creates values with scm_allocate_tagged
* libguile/vm-engine.c (halt): Make values with scm_allocate_tagged.
2025-06-23 20:45:00 +02:00
Andy Wingo
20fcb8ac12 Convert hash tables away from scm_cell
* libguile/hashtab.h (SCM_HASHTABLE_VECTOR):
(SCM_SET_HASHTABLE_VECTOR):
(SCM_HASHTABLE):
(SCM_HASHTABLE_N_ITEMS):
(SCM_SET_HASHTABLE_N_ITEMS):
(SCM_HASHTABLE_INCREMENT):
(SCM_HASHTABLE_DECREMENT):
(SCM_HASHTABLE_UPPER):
(SCM_HASHTABLE_LOWER):
(SCM_HASHTABLE_N_BUCKETS):
(SCM_HASHTABLE_BUCKET):
(SCM_SET_HASHTABLE_BUCKET): Remove these internal definitions from the
public interface.
(scm_t_hashtable): Add a tag, and add buckets.
(scm_is_hashtable):
(scm_to_hashtable):
(scm_from_hashtable): New helpers.
* libguile/modules.c (scm_module_reverse_lookup): Adapt to hash table
API change.
* libguile/hashtab.c: Rework to access hash table data through the typed
"struct scm_t_hashtable".
2025-06-23 20:44:55 +02:00
Andy Wingo
b25a743cf9 Get strings, symbols, stringbufs off scm_double_cell
* libguile/symbols.h (scm_is_symbol, scm_to_symbol, scm_from_symbol):
Define some helpers and a "struct scm_symbol".
* libguile/strings-internal.h (scm_i_string_data): Remove.
* libguile/print.c (write_char_in_string, write_narrow_string)
(write_wide_string): Refactor to avoid per-char narrow checks.
(write_character): Move up.
(iprin1): Adapt to call write_narrow_string / write_wide_string.
* libguile/srfi-13.c (scm_string_eq): Avoid scm_i_string_data.
* libguile/strings.c (scm_is_stringbuf, scm_to_stringbuf)
(scm_from_stringbuf, stringbuf_is_wide, stringbuf_is_narrow)
(stringbuf_is_mutable, stringbuf_set_mutable, stringbuf_length)
(as_narrow_stringbuf, as_wide_stringbuf, narrow_stringbuf_chars)
(wide_stringbuf_chars, scm_to_string, scm_from_string, string_is_read_only)
(string_is_shared, string_stringbuf, string_aliased_string, string_start)
(string_length): New inline function helpers, to replace a pile of
macros.  Adapt all users.
2025-06-23 15:00:09 +02:00
Andy Wingo
c8cd88b533 Remove SCM_IMMUTABLE_CELL, SCM_IMMUTABLE_DOUBLE_CELL
* libguile/snarf.h (SCM_IMMUTABLE_CELL):
(SCM_IMMUTABLE_DOUBLE_CELL): Remove.  No longer used.  Hopefully there
are no direct external users!
2025-06-23 15:00:09 +02:00
Andy Wingo
02c2516b35 Remove SCM_IMMUTABLE_POINTER
* libguile/foreign.h (SCM_IMMUTABLE_POINTER): Remove.  This was part of
the implementation of static subrs, a long long time ago, but hasn't
been used since 2013 (27337b6373).
2025-06-23 15:00:09 +02:00
Andy Wingo
c370d12d03 Better type-safety for snarfed immutable strings
* libguile/strings.h: Add struct types for stringbufs and strings.
(SCM_IMMUTABLE_STRINGBUF, SCM_IMMUTABLE_STRING): Use the new data types.
2025-06-23 15:00:04 +02:00
Andy Wingo
4702becf89 Move internal string interface definitions to internal header
* libguile/strings-internal.h: New file.
* libguile/strings.h: Gut.
* libguile/Makefile.am: Add new file.
* libguile/array-handle.c:
* libguile/bytevectors.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/hash.c:
* libguile/i18n.c:
* libguile/init.c:
* libguile/intrinsics.c:
* libguile/load.c:
* libguile/memoize.c:
* libguile/numbers.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/rw.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/strings.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/throw.c: Include new file.
2025-06-23 08:44:24 +02:00
Andy Wingo
342a58ad36 scm_is_string is a normal inline function
* libguile/strings.h (scm_is_string): Change to be static inline.
* libguile/inline.c: No need to include strings.h
2025-06-23 08:44:24 +02:00
Andy Wingo
9fd851da65 Get fractions off scm_double_cell
* libguile/numbers.h (scm_t_double, scm_t_complex): Change type and pad
to scm_t_bits.
(struct scm_fraction): New type.
(scm_is_fraction, scm_to_fraction, scm_from_fraction)
(scm_fraction_numerator, scm_fraction_denominator): New helpers.
(SCM_FRACTIONP, SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR): Use
new helpers.
* libguile/numbers.c (scm_i_make_ratio_already_reduced): Allocate using
scm_allocate_tagged.
2025-06-23 08:44:24 +02:00
Andy Wingo
7a749ef79c SCM_ALIGNED is always available
_Alignas is C11.

* libguile/scm.h (SCM_ALIGNED): Always present.
* libguile/snarf.h:
* libguile/strings.h:
* libguile/symbols.h: Always have SCM_ALIGNED available.
2025-06-20 22:18:46 +02:00
Andy Wingo
9290698977 Move atomic box off of scm_cell
* libguile/Makefile.am:
* libguile/atomic.h: Make private.  Define "struct scm_atomic_box".
* libguile/atomic.c: Allocate scm_atomic_box via scm_allocate_tagged.
2025-06-20 16:23:02 +02:00
Andy Wingo
796798b400 Move variables off of scm_cell
* libguile/variable.h:
* libguile/variable.c: Define a "struct scm_variable" and allocate it
via scm_allocate_tagged.
2025-06-20 16:11:07 +02:00
Andy Wingo
b262df6ca7 Move keywords off of scm_cell
* libguile/keywords-internal.h: New file.
* libguile/Makefile.am (noinst_HEADERS): Add new file.
* libguile/hash.c:
* libguile/init.c:
* libguile/keywords.c: Include new file.
(scm_symbol_to_keyword): Allocate via scm_allocate_tagged.
2025-06-20 15:57:37 +02:00
Andy Wingo
27caa4cb98 Move SCM_CARLOC, SCM_CDRLOC to pairs.h
* libguile/gc.h:
* libguile/pairs.h (scm_pair_car_loc, scm_pair_cdr_loc): New helpers.
(SCM_CARLOC, SCM_CDRLOC): Move here from gc.h.
* libguile/list.c (scm_list_1, scm_list_2, scm_list_3): Just use
scm_cons.
2025-06-20 15:46:57 +02:00
Andy Wingo
7997496a32 Move pairs off of scm_cell
* libguile/pairs.h: Remove inline scm_cons, scm_car, scm_cdr defnitions;
this is less important now with the VM.  Add a "struct scm_pair", and
make all SCM_CAR / SCM_CDR checks use it.  For now it does type checking
as well.
* libguile/pairs.c (scm_cons, scm_car, scm_cdr): Implement here.
* libguile/scm.h (SCM_DEBUG_PAIR_ACCESSES): No more macro!
2025-06-20 15:33:33 +02:00
Andy Wingo
fbbe5fa873 Move dynamic states off of scm_cell
* libguile/fluids-internal.h: Add struct scm_dynamic_state_snapshot
definition.
* libguile/fluids.h (scm_is_dynamic_state): Inline.
* libguile/fluids.c: Use "struct scm_dynamic_state_snapshot".
2025-06-20 14:56:28 +02:00
Andy Wingo
453fe41a26 Move fluids off of scm_cell
* libguile/fluids-internal.h: New file for internal definitions.
* libguile/dynstack.c:
* libguile/init.c:
* libguile/intrinsics.c:
* libguile/modules.c:
* libguile/print.c:
* libguile/threads.c: Include new internal file.
* libguile/fluids.c: Use "struct scm_fluid".
* libguile/Makefile.am: Add new file.
2025-06-20 14:43:10 +02:00
Andy Wingo
8141c35ec4 Change to not inline scm_cell / scm_double_cell / scm_words
* libguile/gc-malloc.c (scm_cell):
(scm_double_cell):
(scm_words): Implement here.
* libguile/gc.h:
* libguile/inline.c: Not here.
2025-06-20 14:23:56 +02:00
Andy Wingo
4bb5fc526b Remove unused variable in hashtab.c
* libguile/hashtab.c:
2025-06-20 14:22:39 +02:00
Andy Wingo
d8c1ea4049 Convert smobs to use scm_allocate_*
* libguile/smob.c (scm_new_smob, scm_new_double_smob): Use
scm_allocate_pointerless, scm_allocate_tagged, or scm_allocate_sloppy,
as appropriate.
2025-06-20 13:03:06 +02:00
Andy Wingo
c800496d27 Use alloca in change_option_setting
* libguile/options.c (change_option_setting): alloca instead of
scm_allocate_sloppy.
2025-06-20 12:48:07 +02:00
Andy Wingo
f2ad6525e6 Convert scm_gc_malloc* calls to scm_allocate*
* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/chooks.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/dynstack.c:
* libguile/ephemerons.c:
* libguile/filesys.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gsubr.c:
* libguile/hashtab.c:
* libguile/i18n.c:
* libguile/integers.c:
* libguile/intrinsics.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/numbers.c:
* libguile/options.c:
* libguile/ports.c:
* libguile/programs.h:
* libguile/random.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/smob.c:
* libguile/srfi-14.c:
* libguile/strings.c:
* libguile/struct.c:
* libguile/threads.c:
* libguile/threads.h:
* libguile/values.c:
* libguile/vm.c: Convert all calls to scm_gc_malloc_pointerless to
scm_allocate_pointerless.  Convert scm_gc_malloc to either
scm_allocate_tagged or scm_allocate_sloppy, depending on whether the
value can be precisely traced or not.
2025-06-20 11:40:01 +02:00
Andy Wingo
290a57b1b0 Add scm_allocate_{pointerless,tagged,sloppy}
* libguile/gc-inline.h (scm_inline_allocate_pointerless):
(scm_inline_allocate_tagged):
(scm_inline_allocate_sloppy):
* libguile/gc.h:
* libguile/gc-malloc.c (scm_allocate_pointerless):
(scm_allocate_tagged):
(scm_allocate_sloppy): New functions.
(scm_gc_malloc):
(scm_gc_malloc_pointerless): Dispatch to scm_allocate functions.
2025-06-20 11:07:34 +02:00
Andy Wingo
a793d371cd Move string-pointer-array handling to posix.c
* libguile/posix.c (free_string_pointers):
(free_string_pointers_on_unwind):
(allocate_string_pointers): Move here from string.c, and use malloc/free
instead of GC facilities. Adapt all users.
* libguile/strings.h:
* libguile/strings.c (scm_i_allocate_string_pointers): Remove.
2025-06-20 11:06:41 +02:00
Andy Wingo
ce2f7847e8 Avoid untagged traced allocation in make-struct/no-tail
* libguile/struct.c (scm_struct_init_1_default):
(scm_struct_init_1): New helpers.
(scm_struct_init_array): Use new helpers.
(scm_struct_init_list): New function.
(scm_make_struct_no_tail): Use scm_struct_init_list instead of mallocing.
2025-06-20 09:27:47 +02:00