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

i#3049: clean postcall_cache when drwrap_exit #3064

Merged
merged 4 commits into from
Jun 22, 2018
Merged
Changes from 3 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
5 changes: 5 additions & 0 deletions ext/drwrap/drwrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,11 @@ drwrap_exit(void)
!dr_unregister_delete_event(drwrap_fragment_delete))
ASSERT(false, "failed to unregister in drwrap_exit");

for (int i = 0; i < POSTCALL_CACHE_SIZE; i++) {
postcall_cache[i] = NULL;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for this CL but it brings up two thoughts:

  1. For large data structures zeroing at exit is costly when there's no chance or re-attach: which is all of the time for regular non-static DR. Inside DR we only zero for doing_detach. We may want to export that for extensions.

  2. We should add a re-attach test for drwrap.

I filed #3065 for this, split from #2157. Let's reference both issues in the merge commit message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

postcall_cache_idx = 0;

hashtable_delete(&replace_table);
hashtable_delete(&replace_native_table);
hashtable_delete(&wrap_table);
Expand Down