Open seanm opened 1 year ago
@afni-rickr @hjmjohnson this is a fixed version of PR #166 which was buggy and undone by PR #170.
Don't merge as-is, I added some asserts to verify the address calculation is correct. They are just there as a test and will be removed.
Alas, no test actually enters this code, as I confirmed with the assert(0)
.
2acc4449 was buggy, and undone with cedc42d2. This essentially restores 2acc4449 without the buggy pointer arithmetic.
Modern compilers optimize memcpy() very well, this will likely produce the same code.