-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[KMP] Fix issue: memory leak found in Base58.decode in iOS #4031
[KMP] Fix issue: memory leak found in Base58.decode in iOS #4031
Conversation
5523f93
to
b94a2e0
Compare
@satoshiotomakan Could you please review this PR? |
b94a2e0
to
355c345
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work as usual! Could you please consider minor changes?
@10gic can you please fix code formatting? The code will be available in the iOS Kotlin package, so it should be readable enough. Please also note that iOS native bindings have been broken by changing |
@10gic is it possible to revert |
I noticed this issue. However, if I fix the too little code indentation in AnyAddress.kt, then Base58.kt will have too much indentation because the adjusted code in AnyAddress.kt is located within the actual companion object code block, which inherently requires more indentation. |
Do you have any other considerations? Since the keywords in different languages are different, avoiding using them is the simplest way. |
The main reason is to avoid unnecessary breaking changes
|
Actually, I didn't intend to adjust this behavior in this PR. I can't remember what issue led me to change it. However, I can try to revert it. |
@satoshiotomakan All comments have been resolved, please review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Fix issue #4030
How to test
Run Rust, C++, Kotlin, Swift tests
Types of changes
Checklist
If you're adding a new blockchain
Screenshots
Before fixing, run Base58.decode 100000 times, it takes up to 200 MB of memory:
After fixing, run Base58.decode 100000 times, it takes up to 97.4 MB of memory:
Solution
The generated code before fixing:
Definition of old readTwBytes:
The generated code after fixing:
Definition of new readTwBytes: