-
Notifications
You must be signed in to change notification settings - Fork 790
Open
Labels
Description
It would be helpful if libffi add an extra optional constant FFI_MAX_CLOSURE_ARGS to the specification. Implementations that are limited in the number of arguments they can use in closures could use this. For instance, on my libffi Emscripten port I can define in ffitarget.h
#define FFI_MAX_CLOSURE_ARGS 122This could then be consumed by ctypes: they currently have:
#define CTYPES_MAX_ARGCOUNT 1024https://github.com/python/cpython/blob/main/Modules/_ctypes/ctypes.h
but it would be nice to replace this with:
#ifdef FFI_MAX_CLOSURE_ARGS
#define CTYPES_MAX_ARGCOUNT FFI_MAX_CLOSURE_ARGS
#else
#define CTYPES_MAX_ARGCOUNT 1024
#endifand then we could fix Python's ctypes test test_callback_too_many_args in Emscripten, which tries to call a function with CTYPES_MAX_ARGCOUNT aguments.
rajsite