mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-24 02:01:06 +00:00
Revert new wasm allocator (#1502)
* Revert "Better allocator for wasm (#1460)"
This reverts commit 1ccb590d18.
* Update wasm files
This commit is contained in:
@@ -132,10 +132,9 @@ pub fn storage(key: &[u8]) -> Option<Vec<u8>> {
|
||||
if length == u32::max_value() {
|
||||
None
|
||||
} else {
|
||||
// Invariants required by Vec::from_raw_parts are not formally fulfilled.
|
||||
// We don't allocate via String/Vec<T>, but use a custom allocator instead.
|
||||
// See #300 for more details.
|
||||
Some(<Vec<u8>>::from_raw_parts(ptr, length as usize, length as usize))
|
||||
let ret = slice::from_raw_parts(ptr, length as usize).to_vec();
|
||||
ext_free(ptr);
|
||||
Some(ret)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,10 +147,9 @@ pub fn child_storage(storage_key: &[u8], key: &[u8]) -> Option<Vec<u8>> {
|
||||
if length == u32::max_value() {
|
||||
None
|
||||
} else {
|
||||
// Invariants required by Vec::from_raw_parts are not formally fulfilled.
|
||||
// We don't allocate via String/Vec<T>, but use a custom allocator instead.
|
||||
// See #300 for more details.
|
||||
Some(<Vec<u8>>::from_raw_parts(ptr, length as usize, length as usize))
|
||||
let ret = slice::from_raw_parts(ptr, length as usize).to_vec();
|
||||
ext_free(ptr);
|
||||
Some(ret)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user