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

Replace r_str_const* with RStrConstPool #15300

Merged
merged 9 commits into from Oct 20, 2019
Merged

Replace r_str_const* with RStrConstPool #15300

merged 9 commits into from Oct 20, 2019

Conversation

thestr4ng3r
Copy link
Contributor

No description provided.

@radare radare changed the title String Pool WIP: String Pool Oct 18, 2019
@thestr4ng3r thestr4ng3r changed the title WIP: String Pool Replace r_str_const* with RStrConstPool Oct 19, 2019
@thestr4ng3r thestr4ng3r marked this pull request as ready for review October 19, 2019 15:21
@thestr4ng3r
Copy link
Contributor Author

These are many commits, but I think they still should NOT be squashed because this makes bisecting easier in case of breakage.

@thestr4ng3r thestr4ng3r force-pushed the str-constpool branch 2 times, most recently from 20bb228 to 4c532b3 Compare October 19, 2019 16:05
@ret2libc
Copy link
Contributor

Probably stupid question, but what's the purpose of r_str_const*?

@thestr4ng3r
Copy link
Contributor Author

It keeps a set of constant strings and if you ask for one, it will either return the matching existing one or create a new one and return that.
The purpose is to avoid strduping the same string over and over again if it is used many times, like in RAnalFunction.cc.
The original r_str_const() used this global __consts which is of course bad if there are multiple RCores.

@radare radare merged commit 80c74d7 into master Oct 20, 2019
@thestr4ng3r thestr4ng3r deleted the str-constpool branch October 20, 2019 10:32
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.

None yet

3 participants