On Sun, Mar 2, 2014 at 3:02 PM, Dave Angel <da...@davea.name> wrote:
> The quote you make from the C standard doesn't mention malloc,  so
>  you're arguing different things. It's not the compiler that casts
>  the malloc return value to the struct type.
>
> C++ does implicitly convert the result,  and the return value of
>  new already has the struct type. But the runtime stores at least
>  two kinds of overhead on occasion,  the array size, and the
>  vtable. So the malloc address can not be assumed to match the
>  struct beginning.  (Not even considering that one can override

Whatever pointer malloc returns is the beginning of the *usable*
space. Any overhead for array size etc has to be before that; a
virtual function table pointer would be inside that space, but that's
very much compiler-dependent.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to