mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 14:33:41 +00:00
runtime: manually initialize xorshift state
This ensures:
1. The xorshift state is initialized during interp.
2. The xorshift state gets initialized to a real random number on
hardware that supports it at runtime.
This fixes a big binary size regression from the previous commit. It's
still not perfect: most programs increase binary size by a few bytes.
But it's not nearly as bad as before.
This commit is contained in:
committed by
Ron Evans
parent
811b13a9d3
commit
f4fd79f7be
@@ -35,6 +35,7 @@ func wasmEntryReactor() {
|
||||
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
|
||||
heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
|
||||
initHeap()
|
||||
initRand()
|
||||
|
||||
if hasScheduler {
|
||||
// A package initializer might do funky stuff like start a goroutine and
|
||||
|
||||
Reference in New Issue
Block a user