Universally-unique gensyms
* libguile/symbols.c (scm_gensym): Make the gensym counter a 128-bit thread-local, initialized to a random number upon the first call to `gensym' within a given thread. This counter is rendered as a 22 byte suffix of mostly base64 digits. * libguile/threads.h (scm_i_thread): Add a thread-local gensym_counter. * libguile/threads.c (guilify_self_1): Initialize gensym_counter to NULL.
This commit is contained in:
parent
d47db067b6
commit
ad432bc831
3 changed files with 44 additions and 11 deletions
|
|
@ -81,6 +81,10 @@ typedef struct scm_i_thread {
|
|||
SCM dynamic_state;
|
||||
SCM dynwinds;
|
||||
|
||||
/* Thread-local gensym counter.
|
||||
*/
|
||||
unsigned char *gensym_counter;
|
||||
|
||||
/* For system asyncs.
|
||||
*/
|
||||
SCM active_asyncs; /* The thunks to be run at the next
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue