diff --git a/Cargo.toml b/Cargo.toml index 6a44c7f..280dec3 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,34 +43,34 @@ rpath = false [dependencies] # Used for PrimInt, so we can check if a generic is an integer num-traits = "0.2" -atomig = { version = "0.4.0", features = ["derive"] } +atomig = { version = "0.4", features = ["derive"] } # Used for time based code (i.e. randomness) -chrono = "0.4.19" +chrono = "0.4" # Used for RNG -rand = "0.8.5" -rand_pcg = "0.3.1" -hashbrown = "0.14.0" -indexmap = "2.0.0" -parking_lot = "0.12.1" -serde = { version = "1.0.137", optional = true, features = ["derive"] } -serde_repr = "0.1.12" -serde-xml-rs = { version = "0.6.0", optional = true } -wasmer = { version = "4.0.0", optional = true, default-features = false, features = ["sys", "wat", "llvm"] } -uuid = "1.2.2" -paste = { version = "1.0.8" } -arcstr = { version = "1.1.4", features = ["std"] } -enum-display-derive = "0.1.1" -anyhow = "1.0.69" -anyhow_ext = "0.2.1" -thiserror = "1.0.39" -stdext = "0.3.1" +rand = "0.8" +rand_pcg = "0.3" +hashbrown = "0.14" +indexmap = "2.0" +parking_lot = "0.12" +serde = { version = "1.0", optional = true, features = ["derive"] } +serde_repr = "0.1" +serde-xml-rs = { version = "0.6", optional = true } +wasmer = { version = "4.2", optional = true, default-features = false, features = ["sys", "wat", "llvm"] } +uuid = "1.5" +paste = { version = "1.0" } +arcstr = { version = "1.1", features = ["std"] } +enum-display-derive = "0.1" +anyhow = "1.0" +anyhow_ext = "0.2" +thiserror = "1.0" +stdext = "0.3" [dev-dependencies] -csv = "1.1.6" -project-root = "0.2.2" -serde_yaml = "0.9.14" -serde_json = "1.0.81" -serde_plain = "1.0.0" +csv = "1.3" +project-root = "0.2" +serde_yaml = "0.9" +serde_json = "1.0" +serde_plain = "1.0" # Allow us to assert whether floats are approximately a value -assert_approx_eq = "1.1.0" -mockall = "0.11.2" \ No newline at end of file +assert_approx_eq = "1.1" +mockall = "0.11" \ No newline at end of file diff --git a/LICENSE b/LICENSE index c2c2146..f58eae5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Deukhoofd +Copyright (c) 2022-2023 Deukhoofd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/utils/random.rs b/src/utils/random.rs index 37eb84c..2ff0f47 100755 --- a/src/utils/random.rs +++ b/src/utils/random.rs @@ -16,7 +16,9 @@ pub struct Random { impl Default for Random { /// The default for the RNG uses the nanoseconds since epoch as seed. fn default() -> Self { - let seed = chrono::Utc::now().timestamp_nanos() as u128; + let seed = chrono::Utc::now() + .timestamp_nanos_opt() + .unwrap_or_else(|| chrono::Utc::now().timestamp()) as u128; Random::new(seed) } } diff --git a/valgrind_suppr b/valgrind_suppr deleted file mode 100644 index d63c5ee..0000000 --- a/valgrind_suppr +++ /dev/null @@ -1,90 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:alloc - fun:__rdl_alloc - fun:_ZN5alloc5alloc5alloc17hc42e909f81160460E - fun:_ZN96_$LT$hashbrown..raw..alloc..inner..Global$u20$as$u20$hashbrown..raw..alloc..inner..Allocator$GT$8allocate17h2c481e4442c55c5dE - fun:_ZN9hashbrown3raw5alloc5inner8do_alloc17h1f83bdd1222cbbb7E - fun:_ZN9hashbrown3raw22RawTableInner$LT$A$GT$17new_uninitialized17h12dbb4fa91b4b3afE - fun:_ZN9hashbrown3raw22RawTableInner$LT$A$GT$22fallible_with_capacity17h6df80e2764604857E - fun:_ZN9hashbrown3raw22RawTableInner$LT$A$GT$14prepare_resize17h71d20d4d23776238E - fun:_ZN9hashbrown3raw21RawTable$LT$T$C$A$GT$14reserve_rehash17h28974fc9c4c277e6E.llvm.15230268944078492848 - fun:_ZN9hashbrown3raw21RawTable$LT$T$C$A$GT$7reserve17h7eee95820260d1e7E.llvm.15230268944078492848 - fun:_ZN9hashbrown3raw21RawTable$LT$T$C$A$GT$6insert17h35ff9588f93ce06cE - fun:_ZN9hashbrown3map28HashMap$LT$K$C$V$C$S$C$A$GT$6insert17h996ff1a9e535e422E -} - -{ - - Memcheck:Leak - fun:malloc - fun:alloc - fun:__rdl_alloc - fun:_ZN5alloc5alloc6Global10alloc_impl17hd6fbb6e351b4be39E.llvm.18227935767307273530 - fun:allocate - fun:_ZN5alloc5alloc15exchange_malloc17h9e4cc8ad48821a81E - fun:new<[[u64; 4]; 2]> - fun:_ZN94_$LT$ahash..random_state..DefaultRandomSource$u20$as$u20$ahash..random_state..RandomSource$GT$15get_fixed_seeds28_$u7b$$u7b$closure$u7d$$u7d$17h1797bff870f50682E - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init28_$u7b$$u7b$closure$u7d$$u7d$17h744caffedf4c7067E - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$15get_or_try_init17hcd2c841e12e37bc0E - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init17h7d3ca5ccc71b3021E - fun:_ZN94_$LT$ahash..random_state..DefaultRandomSource$u20$as$u20$ahash..random_state..RandomSource$GT$15get_fixed_seeds17h2a6c6672bd2f8f7bE - fun:_ZN5ahash12random_state11RandomState3new17he4bd97026fbf5adcE.llvm.11960766389962301245 - fun:_ZN75_$LT$ahash..random_state..RandomState$u20$as$u20$core..default..Default$GT$7default17h65efd61ef64a7f0dE - fun:_ZN87_$LT$hashbrown..map..HashMap$LT$K$C$V$C$S$C$A$GT$$u20$as$u20$core..default..Default$GT$7default17h40e688f79e703e93E.llvm.35124437821632695 -} - -{ - - Memcheck:Leak - match-leak-kinds: reachable - fun:malloc - fun:alloc - fun:__rdl_alloc - fun:_ZN5alloc5alloc6Global10alloc_impl17h0263a87402431af1E.llvm.1186731428384934186 - fun:allocate - fun:_ZN5alloc5alloc15exchange_malloc17h2285591b899cc9f4E - fun:new> - fun:_ZN5ahash12random_state11RandomState7get_src28_$u7b$$u7b$closure$u7d$$u7d$17h5cf982d28005fdddE - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init28_$u7b$$u7b$closure$u7d$$u7d$17h72179437b77bfeebE - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$15get_or_try_init17h4373eb8bae30d42dE.llvm.10117491539980278462 - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init17hec6279877245cea1E - fun:_ZN5ahash12random_state11RandomState7get_src17haf7fc09e2535a0a7E.llvm.11960766389962301245 - fun:_ZN5ahash12random_state11RandomState3new17he4bd97026fbf5adcE.llvm.11960766389962301245 - fun:_ZN75_$LT$ahash..random_state..RandomState$u20$as$u20$core..default..Default$GT$7default17h65efd61ef64a7f0dE - fun:_ZN87_$LT$hashbrown..map..HashMap$LT$K$C$V$C$S$C$A$GT$$u20$as$u20$core..default..Default$GT$7default17h40e688f79e703e93E.llvm.35124437821632695 -} - -{ - - Memcheck:Leak - match-leak-kinds: reachable - fun:malloc - fun:alloc - fun:__rdl_alloc - fun:_ZN5alloc5alloc6Global10alloc_impl17h0263a87402431af1E.llvm.1186731428384934186 - fun:allocate - fun:_ZN5alloc5alloc15exchange_malloc17h2285591b899cc9f4E - fun:new - fun:_ZN5ahash12random_state11RandomState7get_src28_$u7b$$u7b$closure$u7d$$u7d$17h5cf982d28005fdddE - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init28_$u7b$$u7b$closure$u7d$$u7d$17h72179437b77bfeebE - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$15get_or_try_init17h4373eb8bae30d42dE.llvm.10117491539980278462 - fun:_ZN9once_cell4race8once_box16OnceBox$LT$T$GT$11get_or_init17hec6279877245cea1E - fun:_ZN5ahash12random_state11RandomState7get_src17haf7fc09e2535a0a7E.llvm.11960766389962301245 - fun:_ZN5ahash12random_state11RandomState3new17he4bd97026fbf5adcE.llvm.11960766389962301245 - fun:_ZN75_$LT$ahash..random_state..RandomState$u20$as$u20$core..default..Default$GT$7default17h65efd61ef64a7f0dE - fun:_ZN9hashbrown3map20HashMap$LT$K$C$V$GT$13with_capacity17h8042103d2e19cc61E -} - -{ - - Memcheck:Leak - fun:malloc - fun:alloc - fun:__rdl_alloc - fun:_ZN5alloc5alloc5alloc17hdc225bf5a9332839E - fun:_ZN6arcstr7arc_str9ThinInner12try_allocate17h5ec0d22c686b0aa1E - fun:_ZN6arcstr7arc_str9ThinInner8allocate17hb1fd6d38fd1e7864E -}