Replace `ffi.callback()` with `ffi.def_extern()`
See original GitHub issueCreate a new issue to track the ffi.callback()
cause MemoryError
on macOS M1.
See comment of @bastibe in https://github.com/bastibe/python-soundfile/issues/325#issuecomment-1048584002
According to https://cffi.readthedocs.io/en/latest/using.html#callbacks,
ffi.callback()
is old style callback, and has many drawbacks, should be replaced by new style callbackdef_extern()
.I’ve looked into this, and actually drafted an implementation of the callbacks locally. However, there is a problem with this approach: Currently, we are using the ABI mode of CFFI. The “new style” callbacks you mentioned require that soundfile uses the API mode of CFFI, which means compiling a bespoke version of soundfile for every operating system and version of Python we support.
While I am certainly open to doing this, especially now that we have CI runners to automate the task, I think it is out-of-scope for this pull request. Please raise the issue in a new issue, or preferably, try to draft a pull request for it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (1 by maintainers)
i’m dead
@f17mkx the package from that comment did not work for me. @hiccup7 I’m working with @bastibe to push an update. You can try the wheel here. I tested it on M1 and it works (install via pip)