1. Python CFFI
  2. Untitled project
  3. cffi

Commits

Armin Rigo  committed befb2fd

Uh, ffi_closure_alloc() and ffi_closure_free() are already defined
in recent versions of <ffi.h>, but of course not all of them.
Rename.

  • Participants
  • Parent commits 49d86c3
  • Branches default

Comments (0)

Files changed (2)

File c/_ffi_backend.c

View file
         ffi_closure *closure = (ffi_closure *)cd->c_data;
         PyObject *args = (PyObject *)(closure->user_data);
         Py_XDECREF(args);
-        ffi_closure_free(closure);
+        cffi_closure_free(closure);
     }
     cdata_dealloc(cd);
 }
         return NULL;
     }
 
-    closure = ffi_closure_alloc();
+    closure = cffi_closure_alloc();
 
     cd = PyObject_New(CDataObject, &CDataOwning_Type);
     if (cd == NULL)
  error:
     closure->user_data = NULL;
     if (cd == NULL)
-        ffi_closure_free(closure);
+        cffi_closure_free(closure);
     else
         Py_DECREF(cd);
     return NULL;

File c/malloc_closure.h

View file
 /******************************************************************/
 
 /* put the item back into the free list */
-static void ffi_closure_free(ffi_closure *p)
+static void cffi_closure_free(ffi_closure *p)
 {
     union mmaped_block *item = (union mmaped_block *)p;
     item->next = free_list;
 }
 
 /* return one item from the free list, allocating more if needed */
-static ffi_closure *ffi_closure_alloc(void)
+static ffi_closure *cffi_closure_alloc(void)
 {
     union mmaped_block *item;
     if (!free_list)