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