From a81f46456709e4aaaa0f1bfbd22dae829632c5b2 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:17:58 -0500 Subject: [PATCH] inserted wee_alloc --- pirates/Cargo.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++++ pirates/Cargo.toml | 1 + pirates/src/lib.rs | 3 +++ 3 files changed, 57 insertions(+) diff --git a/pirates/Cargo.lock b/pirates/Cargo.lock index 4556b25..add7169 100644 --- a/pirates/Cargo.lock +++ b/pirates/Cargo.lock @@ -17,12 +17,30 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + [[package]] name = "libm" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + [[package]] name = "nalgebra" version = "0.32.3" @@ -89,6 +107,7 @@ version = "0.1.0" dependencies = [ "libm", "nalgebra", + "wee_alloc", ] [[package]] @@ -108,3 +127,37 @@ name = "typenum" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/pirates/Cargo.toml b/pirates/Cargo.toml index 2fddb0e..99a95fc 100644 --- a/pirates/Cargo.toml +++ b/pirates/Cargo.toml @@ -12,6 +12,7 @@ crate-type = ["cdylib"] [dependencies] libm = "0.2.7" +wee_alloc = "0.4.5" [dependencies.nalgebra] version = "0.32.3" diff --git a/pirates/src/lib.rs b/pirates/src/lib.rs index d21b2a2..2743d9a 100644 --- a/pirates/src/lib.rs +++ b/pirates/src/lib.rs @@ -5,6 +5,9 @@ fn handle_panic(_: &core::panic::PanicInfo) -> ! { loop {} } +extern crate wee_alloc; +#[global_allocator] +static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; use core::sync::atomic::{AtomicU32, Ordering}; use libm::{self, Libm};