Skip to content

Commit

Permalink
Merge branch 'fraccaman/replace-wee-alloc' (#3331)
Browse files Browse the repository at this point in the history
* origin/fraccaman/replace-wee-alloc:
  wasm_for_tests: delete old unused `wasm_source/Cargo.toml`
  changelog: add #3331
  switch wee_alloc for rlsf
  • Loading branch information
brentstone committed May 31, 2024
2 parents 787162a + 8d627ec commit 657a604
Show file tree
Hide file tree
Showing 67 changed files with 265 additions and 224 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/3331-replace-wee-alloc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Switched from wee allocator to rlsf for WASM.
([\#3331](https://github.com/anoma/namada/pull/3331))
8 changes: 4 additions & 4 deletions crates/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ pub fn transaction(_attr: TokenStream, input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as ItemFn);
let ident = &ast.sig.ident;
let gen = quote! {
// Use `wee_alloc` as the global allocator.
// Use `rlsf` as the global allocator.
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
static ALLOC: rlsf::SmallGlobalTlsf = rlsf::SmallGlobalTlsf::new();

#ast

Expand Down Expand Up @@ -88,9 +88,9 @@ pub fn validity_predicate(
let ast = parse_macro_input!(input as ItemFn);
let ident = &ast.sig.ident;
let gen = quote! {
// Use `wee_alloc` as the global allocator.
// Use `rlsf` as the global allocator.
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
static ALLOC: rlsf::SmallGlobalTlsf = rlsf::SmallGlobalTlsf::new();

#ast

Expand Down
Loading

0 comments on commit 657a604

Please sign in to comment.