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 dbe6bf2 commit be62ab2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 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,7 +24,8 @@ 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.
pub struct NeverGrowInPlaceAllocator;
#[expect(dead_code)]
struct NeverGrowInPlaceAllocator;

// SAFETY: Methods simply delegate to `System` allocator
#[expect(unsafe_code, clippy::undocumented_unsafe_blocks)]
Expand Down

0 comments on commit be62ab2

Please sign in to comment.