mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
+ adding compiler features for no_std environments other than wasm (i.e. SGX) (#2421)
This commit is contained in:
@@ -35,3 +35,5 @@ std = [
|
||||
nightly = []
|
||||
strict = []
|
||||
wasm-nice-panic-message = []
|
||||
no_panic_handler = []
|
||||
no_oom = []
|
||||
|
||||
@@ -22,6 +22,7 @@ use core::{intrinsics, panic::PanicInfo};
|
||||
use rstd::{vec::Vec, cell::Cell};
|
||||
use primitives::Blake2Hasher;
|
||||
|
||||
#[cfg(not(feature = "no_panic_handler"))]
|
||||
#[panic_handler]
|
||||
#[no_mangle]
|
||||
pub fn panic(info: &PanicInfo) -> ! {
|
||||
@@ -43,6 +44,7 @@ pub fn panic(info: &PanicInfo) -> ! {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_oom"))]
|
||||
#[alloc_error_handler]
|
||||
pub extern fn oom(_: ::core::alloc::Layout) -> ! {
|
||||
static OOM_MSG: &str = "Runtime memory exhausted. Aborting";
|
||||
|
||||
@@ -13,3 +13,4 @@ default = ["std"]
|
||||
std = []
|
||||
nightly = []
|
||||
strict = []
|
||||
no_global_allocator = []
|
||||
|
||||
Regular → Executable
+1
@@ -26,6 +26,7 @@ extern "C" {
|
||||
/// Wasm allocator
|
||||
pub struct WasmAllocator;
|
||||
|
||||
#[cfg(not(feature = "no_global_allocator"))]
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: WasmAllocator = WasmAllocator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user