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

setjmp in tess.c crashes when using a custom allocator #39

Open
TylerGlaiel opened this issue Mar 21, 2021 · 0 comments
Open

setjmp in tess.c crashes when using a custom allocator #39

TylerGlaiel opened this issue Mar 21, 2021 · 0 comments

Comments

@TylerGlaiel
Copy link

its an alignment issue because jumpbuf needs to be aligned to 16 bytes, so I had to make sure my custom allocator was aligning stuff to 16 byte boundaries (instead of 8 bytes as indicated by alignof(std::max_align_t))

it was a little bit frustrating to figure this out, so if setjmp is really absolutely necessary for memory management, then in the comment about TESSalloc it should mention that it needs to return buffers aligned to 16-byte boundaries, or add an "alignment" parameter to memalloc since I'm pretty sure only the TESStesselator needs to be aligned anyway

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

No branches or pull requests

1 participant