-
Notifications
You must be signed in to change notification settings - Fork 610
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
Added !defined(HB_NO_MT) to conditional compilation that does '#include <atomic>' #4119
Added !defined(HB_NO_MT) to conditional compilation that does '#include <atomic>' #4119
Conversation
…de <atomic>' The `#include <atomic>` declaration causes problems for WebAssembler, a single threaded platform. HarfBuzz already has a preexisting macro to disable multithreading, so we're using that.
This is problematic. The |
I think on |
Or would that be even worse for WebAssembly? |
|
Thanks, this looks good! Just out of curiosity, why are memory fences needed at all in single threaded environments with |
See: It's because we abuse the memory layout. and have a struct where accessing the second member can possibly cause a crash, so we need to disable compiler reordering access. |
I'm almost certainly preaching to the choir on this, but it feels unfortunate that we have this partial bounds checking (which if I'm reading things correctly, only catches scenarios where the offset is so large the pointer arithmetic overflows) and memory fences at all. As an experiment, I tried disabling the memory fences with a gross hack ( In any case, thanks for all of your help! |
Are you compiling |
I am not; I looked at it a while ago and had concerns, the details of which I don't recall. I'll take a look again - thanks! |
Or |
So I reviewed the literature for I like the idea of trimming down HarfBuzz to make it smaller, but not at the cost of not being able to handle something out there that might be esoteric, but in practice someone in the ether might want me to handle successfully. HarfBuzz has given me a luxury of ignorance about the details of fonts that I'm reluctant to give up. Thanks! |
The
#include <atomic>
declaration causes problems for WebAssembler, a single threaded platform. HarfBuzz already has a preexisting macro to disable multithreading, so we're using that.