Remove init for Blake3

This commit is contained in:
Christoffer Lerno
2026-02-17 17:43:54 +01:00
parent 3ac701be0e
commit 143fa70f87

View File

@@ -6,7 +6,7 @@
// https://github.com/BLAKE3-team/BLAKE3/blob/master // https://github.com/BLAKE3-team/BLAKE3/blob/master
// //
module std::hash::blake3; module std::hash::blake3;
import std::thread;
const BLOCK_SIZE = 64; const BLOCK_SIZE = 64;
const CHUNK_SIZE = 1024; const CHUNK_SIZE = 1024;
@@ -55,12 +55,15 @@ bool cpuinfo_initd @local = false;
<* <*
Cache some information at runtime about the current processor and platform, as needed for optimizations. Cache some information at runtime about the current processor and platform, as needed for optimizations.
*> *>
fn void init_blake3() @local @init fn void init_blake3() @local
{ {
$if IS_X86: static OnceFlag run_once;
cpudetect::x86_initialize_cpu_features(); // query all x86 feature flags, one time run_once.call(fn() {
$endif $if IS_X86:
cpuinfo_initd = true; cpudetect::x86_initialize_cpu_features(); // query all x86 feature flags, one time
$endif
cpuinfo_initd = true;
});
} }
<* Check whether a given CPU flag is set (x86/x86_64 only). *> <* Check whether a given CPU flag is set (x86/x86_64 only). *>