Switch nix-shell to use oxalica overlay to get miri working, fix memory leak in archetypes

This commit is contained in:
SeanOMik 2024-03-31 10:56:04 -04:00
parent a17c035c05
commit a39d259bb4
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
3 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,9 @@ impl Drop for ComponentColumn {
unsafe { unsafe {
// TODO: trigger drop on the components // TODO: trigger drop on the components
let layout = self.info.layout(); // SAFETY: The size of the data buffer is the capcity times the size of a component
let size = self.info.layout().size() * self.capacity;
let layout = Layout::from_size_align_unchecked(size, self.info.layout().align());
dealloc(data, layout); dealloc(data, layout);
} }
} }

View File

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "nightly" channel = "nightly-2023-11-21"
date = "2023-11-21" #date = "2023-11-21"
targets = [ "x86_64-unknown-linux-gnu" ] targets = [ "x86_64-unknown-linux-gnu" ]

View File

@ -1,6 +1,10 @@
let let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); rust_overlay = import (builtins.fetchTarball https://github.com/oxalica/rust-overlay/archive/master.tar.gz);
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; }; nixpkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rust = (nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
extensions = [ "rust-analysis" "rust-src" "miri-preview" ];
};
in in
with nixpkgs; with nixpkgs;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -15,13 +19,7 @@ in
mold mold
udev udev
lua5_4_compat lua5_4_compat
((nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain.toml; }).rust.override { rust
extensions = [
"rust-src"
"rust-analysis"
"miri-preview"
];
})
]; ];
buildInputs = [ buildInputs = [
udev alsa-lib libGL gcc udev alsa-lib libGL gcc