Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Remove the oom-handler feature
Browse files Browse the repository at this point in the history
Since the `alloc_error_handler` feature has now been stabilized, it has been removed from `nightly`
  • Loading branch information
jessebraham committed Apr 25, 2023
1 parent 66d4b2e commit 4303757
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,3 @@ default-target = "riscv32imc-unknown-none-elf"
[dependencies]
critical-section = "1.1.1"
linked_list_allocator = { version = "0.10.5", default-features = false, features = ["const_mut_refs"] }

[features]
# Provides a basic `#[alloc_error_handler]` which simply panics when an
# allocation fails. If this feature is NOT enabled, which it is not by
# default, then a handler needs to be defined in any binary depending on
# this package.
# As of Rust 1.68 the `default_alloc_error_handler` feature is enabled by
# default, which will cause the compiler to automatically generate a handler
# which panics when out of memory.
oom-handler = []
10 changes: 0 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
//! A simple `no_std` heap allocator for RISC-V and Xtensa processors from
//! Espressif.
//!
//! A simple `no_std` heap allocator for RISC-V and Xtensa processors from
//! Espressif. Supports all currently available ESP32 devices.
//!
//! **NOTE:** using this as your global allocator requires using Rust 1.68 or
//! greater, or the `nightly` release channel.
#![no_std]
#![cfg_attr(feature = "oom-handler", feature(alloc_error_handler))]

use core::{
alloc::{GlobalAlloc, Layout},
Expand All @@ -19,12 +15,6 @@ use core::{
use critical_section::Mutex;
use linked_list_allocator::Heap;

#[cfg(feature = "oom-handler")]
#[alloc_error_handler]
fn oom(_: core::alloc::Layout) -> ! {
panic!("Allocation failed, out of memory");
}

pub struct EspHeap {
heap: Mutex<RefCell<Heap>>,
}
Expand Down

0 comments on commit 4303757

Please sign in to comment.