libdart icon indicating copy to clipboard operation
libdart copied to clipboard

fixing an alignment bug in the C API

Open Cfretz244 opened this issue 1 year ago • 0 comments

The purpose of this PR is to fix an embarrassing oversight in the C API header. Apparently the C API header never declared proper alignment requirements for the opaque buffers they contain. The C API was added near the end of the project and its testing isn't as comprehensive as the rest of the project. Additionally our usage was usually with heap-backed objects that would've been aligned by the global allocator. For the time being I've updated it to force alignment to whatever is the biggest between long long, double, and void*, hopefully this will suffice.

Testing Criteria:

  • Hopefully the test harness for this project still works. If so, the PR checks.

Cfretz244 avatar Jan 19 '24 23:01 Cfretz244