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

refactor(backend-common): Avoid memory accesses on zero size reads #2627

Merged
merged 2 commits into from
May 10, 2023

Conversation

DennisInSky
Copy link
Member

Partially resolves #2095.

  • do not access memory on zero size reads

It is not quite clear what needs to be changed/optimised in lazy-pages with regards to it. @grishasobol can you please clarify?

@reviewer-or-team

@DennisInSky DennisInSky self-assigned this May 5, 2023
@DennisInSky DennisInSky added the A0-pleasereview PR is ready to be reviewed by the team label May 5, 2023
Copy link
Contributor

@shamilsan shamilsan left a comment

Choose a reason for hiding this comment

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

Great 👍

@NikVolf
Copy link
Member

NikVolf commented May 8, 2023

@grishasobol ?

Copy link
Member

@grishasobol grishasobol left a comment

Choose a reason for hiding this comment

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

Change this comment please

// TODO: here we suppose zero byte access like one byte access, because
// backend memory impl can access memory even in case access has size 0.
// We can optimize this if will ignore zero bytes access in core-backend (issue #2095).

@DennisInSky
Copy link
Member Author

Change this comment please

// TODO: here we suppose zero byte access like one byte access, because
// backend memory impl can access memory even in case access has size 0.
// We can optimize this if will ignore zero bytes access in core-backend (issue #2095).

@grishasobol can you please elabortae on how it has to be changed? I asked you about it above - I do not quite understand how it can be optimised or how the comment has to be changed.

@grishasobol
Copy link
Member

Change this comment please

// TODO: here we suppose zero byte access like one byte access, because
// backend memory impl can access memory even in case access has size 0.
// We can optimize this if will ignore zero bytes access in core-backend (issue #2095).

@grishasobol can you please elabortae on how it has to be changed? I asked you about it above - I do not quite understand how it can be optimised or how the comment has to be changed.

Ok, leave only the first sentence

 // NOTE: here we suppose zero byte access like one byte access, because 
 // backend memory impl can access memory even in case access has size 0. 

We cannot make panic here because we must support old runtimes

@DennisInSky DennisInSky merged commit 4db082b into master May 10, 2023
8 checks passed
@DennisInSky DennisInSky deleted the dd/noop-on-zero-size-reads branch May 10, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Take in account zero size memory accesses in sys-calls.
6 participants