MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _cffi_convert_array_argument

Function _cffi_convert_array_argument

pager_lib/cffi/_cffi_include.h:317–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315};
316
317_CFFI_UNUSED_FN static int
318_cffi_convert_array_argument(struct _cffi_ctypedescr *ctptr, PyObject *arg,
319 char **output_data, Py_ssize_t datasize,
320 struct _cffi_freeme_s **freeme)
321{
322 char *p;
323 if (datasize < 0)
324 return -1;
325
326 p = *output_data;
327 if (p == NULL) {
328 struct _cffi_freeme_s *fp = (struct _cffi_freeme_s *)PyObject_Malloc(
329 offsetof(struct _cffi_freeme_s, alignment) + (size_t)datasize);
330 if (fp == NULL)
331 return -1;
332 fp->next = *freeme;
333 *freeme = fp;
334 p = *output_data = (char *)&fp->alignment;
335 }
336 memset((void *)p, 0, (size_t)datasize);
337 return _cffi_convert_array_from_object(p, ctptr, arg);
338}
339
340_CFFI_UNUSED_FN static void
341_cffi_free_array_arguments(struct _cffi_freeme_s *freeme)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected