-
-
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
Fix Base64#encode, exclude last 3 bytes from bswap #10752
Conversation
… correct memory access), and process them manually
Also possible remove bswap at all, and use this code in main loop also, but this seems 7% slower. |
If |
I think this is fine, thanks! @didactic-drunk we already use mmap for fibers, so that's already a thing, though you have to use |
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.
Thank you!
@asterite Today's purpose is allocatong a guard page after the A general purpose This shard uses |
Never mind. I'm withdrawing my |
Oh, I think I understand now what you mean by protrcting the heap. But we use boehm GC for allocating memory, I'm not sure how we can also use mmap. Plus string literals use ROM data. So I'm not sure it can help in this case. But I know nothing about mmap. |
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.
Thank you @kostya 🙏
@asterite I'm not suggesting protecting the heap, but Pseudo code
|
Thanks, @kostya |
There is no specs, because I dont know how to really test guarded memory access, but test for various lengths percent 3 (from 0 to 7), already is: https://github.com/crystal-lang/crystal/blob/master/spec/std/base64_spec.cr#L7