----- Original Message ----- 
From: "Robert Rothenberg" <[EMAIL PROTECTED]>
To: <perl-xs@perl.org>
Sent: Tuesday, July 19, 2005 3:59 AM
Subject: Does Devel::Peek do anything to scalars to


>
> In Perl, I have a blessed scalar reference which contains an IV that is
> the pointer to a C struct which contains the data for the object.
>
> I've added a method which calls realloc() to reallocate more space, and
> update the IV appropriately:
>
>      copy = self;
>      if ((self = (Node*) realloc(self, (size_t) SIZE(count+num)))
>        == NULL)
>        croak("cannot add another child: realloc failed");
>
>      if (copy != self) {
>        SvREADONLY_off((SV*)SvRV(n));
>        sv_setiv((SV*)SvRV(n), (IV) self);
>        SvREADONLY_on((SV*)SvRV(n));
>      }
>
> In testing, this crashes.
>

[snip]

> I'm using perl 5.8.7, compiled with MS Visual C++ Toolkit 2003 (the free
> version).


The header file 'windef.h' defines a structure named 'SIZE' - so if your
code includes either 'windef.h' or 'windows.h', then there would surely be a
problem with that code. But (I think) it would be the sort of problem that
prevents that code from even compiling, and there should at least be some
well-heralded warnings. Yet I gather the code is compiling ok, without
issuing any warnings.

Just thought I'd mention it ....

Cheers,
Rob

Reply via email to