typedef struct { /* user context passed as the first argument to the 2 functions */ void *ctx;
/* allocate a memory mapping */ void* (*alloc) (void *ctx, size_t size); /* release a memory mapping */ void (*free) (void *ctx, void *ptr, size_t size); } PyMemMappingAllocator; The PyMemMappingAllocator structure is very specific to the pymalloc allocator. There is no "resize", "lock" nor "protect" method. There is no way to configure protection or flags of the mapping. The PyMem_SetMappingAllocator() function was initially called _PyObject_SetArenaAllocator(). I'm not sure that the structure and the 2 related functions should be public. Can an extension module call private (_Py*) functions or use a private structure? Or the structure might be renamed to indicate that it is specific to arenas? What do you think? Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com