1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 15:40:38 +02:00

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.
This commit is contained in:
Andy Wingo 2025-06-25 10:46:43 +02:00
parent a6b848dcba
commit 552960b3e2
73 changed files with 244 additions and 211 deletions

View file

@ -50,7 +50,7 @@
#include "stime.h"
#include "strings-internal.h"
#include "symbols.h"
#include "threads.h"
#include "threads-internal.h"
#include "variable.h"
#include "vectors.h"
@ -328,9 +328,7 @@ scm_c_random_bignum (scm_t_rstate *state, SCM m)
/* we know the result will be this big */
mpz_realloc2 (result, m_bits);
random_chunks =
(uint32_t *) scm_gc_calloc (num_chunks * sizeof (uint32_t),
"random bignum chunks");
random_chunks = scm_calloc (num_chunks * sizeof (uint32_t));
do
{
@ -370,6 +368,7 @@ scm_c_random_bignum (scm_t_rstate *state, SCM m)
mpz_clear (zm);
SCM ret = scm_from_mpz (result);
mpz_clear (result);
free (random_chunks);
return ret;
}