Skip to content

Commit

Permalink
vm: use rand() for windows for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Aug 9, 2024
1 parent ee77135 commit 2581432
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vm/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ factor_vm::factor_vm(THREADHANDLE thread)
sampler_thread(NULL)
#endif
{
srandom(time(NULL));
srand(time(NULL));
uint32_t r1 = (((uint16_t)rand() << 17) + ((uint16_t)rand() << 2) + ((uint16_t)rand()>>13));
object_counter = (cell)r1;
#ifdef FACTOR_64
object_counter = ((cell)random()<<32) + random();
#else
object_counter = (cell)random();
object_counter <<= 32;
uint32_t r2 = (((uint16_t)rand() << 17) + ((uint16_t)rand() << 2) + ((uint16_t)rand()>>13));
object_counter += r2;
#endif
primitive_reset_dispatch_stats();
}
Expand Down

0 comments on commit 2581432

Please sign in to comment.