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

Separate the API between cached/uncached methods #5

Merged
merged 3 commits into from
Aug 15, 2023
Merged

Conversation

patacca
Copy link
Collaborator

@patacca patacca commented Aug 9, 2023

To avoid issues with cached/uncached objects below the function level (basic blocks, instructions, ....) it's better to have two separate APIs.

Ex:

p = ProgramBinExport("/path/to/file")
for f in p.values():
    for b in f.blocks:
        # do stuff
    for b in f.blocks: # cached object
        # do stuff
p = ProgramBinExport("/path/to/file")
for f in p.values():
    for b in f.uncached_blocks:
        # do stuff
    for b in f.uncached_blocks: # uncached object
        # do stuff

The user must ensure to never mix the cached and uncached behavior to avoid possible issues.

@patacca patacca requested a review from RobinDavid August 9, 2023 13:09
@patacca
Copy link
Collaborator Author

patacca commented Aug 9, 2023

This PR is based on top of #4

@RobinDavid RobinDavid merged commit 42b0764 into main Aug 15, 2023
@RobinDavid RobinDavid deleted the fix_caching branch August 15, 2023 19:00
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