<p dir="ltr"><br>
On 20 Jun 2013 02:03, "Victor Stinner" <<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>> wrote:<br>
><br>
> 2013/6/19 Kristján Valur Jónsson <<a href="mailto:kristjan@ccpgames.com">kristjan@ccpgames.com</a>>:<br>
> > Oh, it should be public, in my opinion.<br>
><br>
> Ok. And do you think that the PyMemMappingAllocator structure is<br>
> complete, or that we should add something to be future-proof? At<br>
> least, PyMemMappingAllocator is enough for pymalloc usage :-)<br>
><br>
> Is PyMemMappingAllocator complete enough for your usage at CCP Games?</p>
<p dir="ltr">Can we go back to calling this the "Arena" allocator? Or at least "Mapped"? When I see "Mapping" in the context of Python I think of the container API, not a memory allocation API.</p>

<p dir="ltr">><br>
> > We do exactly that when we embed python into UnrealEngine.  We keep pythons internal PyObject_Mem allocator, but have it ask UnrealEngine for its arenas.  That way, we can still keep track of python's memory usage from with the larger application, even if the granularity of memory is now on an "arena" level, rather than individual allocs.<br>

><br>
> I hope that the PEP 445 is flexible enough to allow you to decide<br>
> which functions are hooked and replaced, and which functions will be<br>
> leaved unchanged. That's why I'm not in favor of the "Make<br>
> PyMem_Malloc() reuse PyMem_RawMalloc() by default" alternative.</p>
<p dir="ltr">It's also why I'm in favour of the "domain" API rather than separate functions.</p>
<p dir="ltr">1. In the initial iteration, just have the three basic domains (raw, interpreter, objects). Replacing allocators for third party libraries is the responsibility of embedding applications.</p>
<p dir="ltr">2. In a later iteration, add "PyMem_AddDomain" and "PyMem_GetDomains" APIs so that extension modules can register new domains for wrapped libraries. Replacing allocators is still the responsibility of embedding applications, but there's a consistent API to do it.</p>

<p dir="ltr">(Alternatively, we could do both now)</p>
<p dir="ltr">And agreed PyMem_Raw* are the only new APIs that should be added to the stable ABI.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Victor<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>