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

Memory metering #40

Merged
merged 3 commits into from
Aug 14, 2016
Merged

Memory metering #40

merged 3 commits into from
Aug 14, 2016

Conversation

axic
Copy link
Member

@axic axic commented Aug 14, 2016

No description provided.

@wanderer
Copy link
Member

lgtm


### Initial memory allocation

Metering call needs to be injected as the very first instruction if preallocated memory pages are defined.
Copy link
Member

@wanderer wanderer Aug 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metering Calls are always injected as the very first instruction regardless if there is preallocated memory or not

Copy link
Member Author

@axic axic Aug 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-allocated memory page is defined by memory in the module section as opposed to opcodes in the func section. So it is not part of what the regular metering code does.

Copy link
Member

@wanderer wanderer Aug 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, but i think i'm confused on this part

Metering call needs to be injected as the very first instruction if preallocated memory pages are defined.

Metering costs need to be added to the first metering call. The first instruction to run is always a metering call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is better wording:

The cost of pre-allocated memory must be included in the very first metering call.

@axic axic merged commit e68c522 into master Aug 14, 2016
@axic axic deleted the memory-metering branch August 14, 2016 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants