Clean up sc-allocator (#9295)

This commit is contained in:
Bastian Köcher
2021-07-07 13:11:31 +02:00
committed by GitHub
parent f388b66ab5
commit 7bbf949296
5 changed files with 5 additions and 19 deletions
+3 -12
View File
@@ -14,16 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
sp-std = { version = "3.0.0", path = "../../primitives/std", default-features = false }
sp-core = { version = "3.0.0", path = "../../primitives/core", default-features = false }
sp-wasm-interface = { version = "3.0.0", path = "../../primitives/wasm-interface", default-features = false }
sp-core = { version = "3.0.0", path = "../../primitives/core" }
sp-wasm-interface = { version = "3.0.0", path = "../../primitives/wasm-interface" }
log = "0.4.11"
thiserror = { version = "1.0.21" }
[features]
default = [ "std" ]
std = [
"sp-std/std",
"sp-core/std",
"sp-wasm-interface/std",
]
thiserror = "1.0.21"
+1 -2
View File
@@ -16,8 +16,7 @@
// limitations under the License.
/// The error type used by the allocators.
#[derive(sp_core::RuntimeDebug)]
#[derive(thiserror::Error)]
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// Someone tried to allocate more memory than the allowed maximum per allocation.
#[error("Requested allocation size is too large")]
@@ -67,7 +67,7 @@
//! This is more pronounced (in terms of absolute heap amounts) with larger allocation sizes.
use crate::Error;
use sp_std::{mem, convert::{TryFrom, TryInto}, ops::{Range, Index, IndexMut}};
use std::{mem, convert::{TryFrom, TryInto}, ops::{Range, Index, IndexMut}};
use sp_wasm_interface::{Pointer, WordSize};
/// The minimal alignment guaranteed by this allocator.