[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

STINNER Victor report at bugs.python.org
Fri Dec 5 22:20:21 CET 2014


STINNER Victor added the comment:

Windows provides:

void * _aligned_malloc(
    size_t size, 
    size_t alignment
);

http://msdn.microsoft.com/en-US/library/8z34s9c6%28v=vs.80%29.aspx

How should we handle platforms which don't provide a memory allocator with an alignment? The simplest option is to return NULL (MemoryError).

Allocating more memory and skip first bytes may work, but how do we retrieve the original address if the function releasing the memory block?

What about Solaris, Mac OS X, FreeBSD, etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18835>
_______________________________________


More information about the Python-bugs-list mailing list