On Thu, Jan 3, 2013 at 11:54 AM, Sven Panne <[email protected]> wrote:

> Could you give detailed steps to reproduce your problem? Have you checked
> that the pointer in question at the point of the assertion is *really*
> aligned (i.e. has 0 as its last bit)?
>

Hi,

Detailed steps to reproduce the problem require a huge amount of underlying
library code, which wouldn't be all that helpful for you :/. i have in the
mean time worked around the problem altogether by using SetInternalField(n,
External::New(...)) instead of SetPointerInInternalField() (which i
_thought_ was just a thin wrapper around the former, but is apparently
not). i have only verified that the pointers are *really* aligned in the
sense that my man pages say:

       The malloc() and calloc() functions return a pointer to the
allocated memory that is  suitably  aligned  for
       any  kind  of  variable.

i can't ever in my life remember having seen a malloc'd address which is
_not_ an even number.

If the system allocator is not returning aligned memory then i'm probably
screwed anyway, so i still suspect a problem/mis-assumption in v8 here
(because all of my memory is coming from the standard allocators resp. (new
T)). That said, using External::New directly works perfectly fine for what
i'm doing, so i don't need any specific alignment requirements. Switching
to External also incidentally fixed a regression i was experiencing
involving accessing internal fields post-destruction (after WeakPtr
cleanup), where Object values would suddenly assert with "is not an Object"
in certain contexts. It seems that that problem (reported in another post
on the same day) was a side-effect of the alignment-related changes resp.
my use of SetPointerIn...() in conjunction with those changes.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to