@@ -729,7 +729,7 @@ uint64_t jl_genrandom(uint64_t rngState[4]) JL_NOTSAFEPOINT
729729 return res ;
730730}
731731
732- static void rng_split ( jl_task_t * from , jl_task_t * to ) JL_NOTSAFEPOINT
732+ void jl_rng_split ( uint64_t to [ 4 ], uint64_t from [ 4 ] ) JL_NOTSAFEPOINT
733733{
734734 /* TODO: consider a less ad-hoc construction
735735 Ideally we could just use the output of the random stream to seed the initial
@@ -747,10 +747,10 @@ static void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT
747747 0x3688cf5d48899fa7 == hash(UInt(3))|0x01
748748 0x867b4bb4c42e5661 == hash(UInt(4))|0x01
749749 */
750- to -> rngState [0 ] = 0x02011ce34bce797f * jl_genrandom (from -> rngState );
751- to -> rngState [1 ] = 0x5a94851fb48a6e05 * jl_genrandom (from -> rngState );
752- to -> rngState [2 ] = 0x3688cf5d48899fa7 * jl_genrandom (from -> rngState );
753- to -> rngState [3 ] = 0x867b4bb4c42e5661 * jl_genrandom (from -> rngState );
750+ to [0 ] = 0x02011ce34bce797f * jl_genrandom (from );
751+ to [1 ] = 0x5a94851fb48a6e05 * jl_genrandom (from );
752+ to [2 ] = 0x3688cf5d48899fa7 * jl_genrandom (from );
753+ to [3 ] = 0x867b4bb4c42e5661 * jl_genrandom (from );
754754}
755755
756756JL_DLLEXPORT jl_task_t * jl_new_task (jl_function_t * start , jl_value_t * completion_future , size_t ssize )
@@ -790,7 +790,7 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion
790790 // Inherit logger state from parent task
791791 t -> logstate = ct -> logstate ;
792792 // Fork task-local random state from parent
793- rng_split ( ct , t );
793+ jl_rng_split ( t -> rngState , ct -> rngState );
794794 // there is no active exception handler available on this stack yet
795795 t -> eh = NULL ;
796796 t -> sticky = 1 ;
0 commit comments