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

Add assert harness around unsafe direct memory access #335

Closed
minborg opened this issue Sep 9, 2021 · 3 comments
Closed

Add assert harness around unsafe direct memory access #335

minborg opened this issue Sep 9, 2021 · 3 comments
Assignees

Comments

@minborg
Copy link
Contributor

minborg commented Sep 9, 2021

No description provided.

@minborg minborg self-assigned this Sep 9, 2021
@minborg
Copy link
Contributor Author

minborg commented Sep 9, 2021

This can be done using the zero-cost assertion mechanism in chronicle-core, e.g.:

    @Override
    public long readEntry(long addr, long pos) {
        assert SKIP_ASSERTIONS || addr != 0 && addr != -1 : "addr: " + addr;
        assert SKIP_ASSERTIONS || assertIfEnabled(nonNegative(), pos) : "pos is negative";
        return OS.memory().readInt(addr + pos);
    }

@hft-team-city
Copy link
Contributor

Released in Chronicle-Map-3.22ea3, BOM-2.22ea23

@hft-team-city
Copy link
Contributor

Released in Chronicle-Map-3.22ea3, BOM-2.22ea29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants