Skip to content

Commit

Permalink
Test: Disable custom allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 12, 2024
1 parent 73610d5 commit 6ce1ea9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/benchmark/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::alloc::{GlobalAlloc, Layout, System};

pub use criterion::*;

#[global_allocator]
static GLOBAL: NeverGrowInPlaceAllocator = NeverGrowInPlaceAllocator;
// #[global_allocator]
// static GLOBAL: NeverGrowInPlaceAllocator = NeverGrowInPlaceAllocator;

/// Global allocator for use in benchmarks.
///
Expand All @@ -24,6 +24,7 @@ static GLOBAL: NeverGrowInPlaceAllocator = NeverGrowInPlaceAllocator;
/// [`GlobalAlloc::realloc`] implementation which *never* grows in place.
/// It therefore represents the "worse case scenario" for memory allocation performance.
/// This behavior is consistent and predictable, and therefore stabilizes benchmark results.
#[expect(dead_code)]
struct NeverGrowInPlaceAllocator;

// SAFETY: Methods simply delegate to `System` allocator
Expand Down

0 comments on commit 6ce1ea9

Please sign in to comment.