[Cython] a warning on using string/buffer objects for getting tmp memory
Robert Bradshaw
robertwb at math.washington.edu
Sun Apr 13 02:33:43 CEST 2008
On Apr 12, 2008, at 4:09 PM, Lisandro Dalcin wrote:
> I've just realized that using a string or buffer object for automatic
> management of memory as I proposed has a pitfall: memory alignement is
> not guaranteed.
>
> So perhaps the only way to go is with this trick is to use a custom
> python object internally calling malloc/free.
It looks like strings are aligned on int boundaries (given their
struct). What guarantee does one have about malloc? I would imagine
we would have a custom object (which would be very simple) and even
faster than a stringobject.
- Robert
More information about the Cython-dev
mailing list