Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename memory_grow to pay_for_memory_grow #85

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stylus-proc/src/methods/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream {
output.extend(quote! {
#[no_mangle]
pub unsafe fn mark_used() {
stylus_sdk::evm::memory_grow(0);
stylus_sdk::evm::pay_for_memory_grow(0);
panic!();
}

Expand Down
4 changes: 2 additions & 2 deletions stylus-sdk/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub fn log<T: SolEvent>(event: T) {

/// This function exists to force the compiler to import this symbol.
/// Calling it will unproductively consume gas.
pub fn memory_grow(pages: u16) {
unsafe { hostio::memory_grow(pages) }
pub fn pay_for_memory_grow(pages: u16) {
unsafe { hostio::pay_for_memory_grow(pages) }
}

wrap_hostio!(
Expand Down
2 changes: 1 addition & 1 deletion stylus-sdk/src/hostio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ extern "C" {
/// Internally the Stylus VM forces calls to this hostio whenever new WASM pages are allocated.
/// Calls made voluntarily will unproductively consume gas.
#[allow(dead_code)]
pub fn memory_grow(pages: u16);
pub fn pay_for_memory_grow(pages: u16);

/// Whether the current call is reentrant.
pub fn msg_reentrant() -> bool;
Expand Down
Loading