#NEWLINE# def new_allocator( self , alloc = None , free = None , should_clear_after_alloc = True ) : #NEWLINE# #INDENT# "Return a new allocator, i.e. a function that behaves like ffi.new()\n        but uses the provided low-level 'alloc' and 'free' functions.\n\n        'alloc' is called with the size as argument.  If it returns NULL, a\n        MemoryError is raised.  'free' is called with the result of 'alloc'\n        as argument.  Both can be either Python function or directly C\n        functions.  If 'free' is None, then no free function is called.\n        If both 'alloc' and 'free' are None, the default is used.\n\n        If 'should_clear_after_alloc' is set to False, then the memory\n        returned by 'alloc' is assumed to be already cleared (or you are\n        fine with garbage); otherwise CFFI will clear it.\n        " #NEWLINE# compiled_ffi = self . _backend . FFI ( ) #NEWLINE# allocator = compiled_ffi . new_allocator ( alloc , free , should_clear_after_alloc ) #NEWLINE# def allocate( cdecl , init = None ) : #NEWLINE# #INDENT# if isinstance ( cdecl , basestring ) : #NEWLINE# #INDENT# cdecl = self . _typeof ( cdecl ) #NEWLINE# #UNINDENT# return allocator ( cdecl , init ) #NEWLINE# #UNINDENT# return allocate