Skip to content

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

@TylerGlaiel

Description

@TylerGlaiel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions