Re: [Arsperl-users] ars_CreateEntry crashing on Windows
Brought to you by:
jeffmurphy
|
From: John U. <joh...@cr...> - 2007-07-22 16:48:09
|
Thanks.
However that is still dangerous. Someone could build perl to use perl =
memory
manager even if the platform isn't windows - it's just a perl build =
option.
I would respectfully suggest that the #ifdef malloc by itself is =
sufficient.
'malloc' will only be defined in the case where perl has been built to =
use
its own memory manager. That is the important point, not what the =
platform
actually is, because perl can be built that way on any platform.=20
Regards,
John.
-----Original Message-----
From: ars...@ar...
[mailto:ars...@ar...] On Behalf Of Jeff Murphy
Sent: 20 July 2007 20:42
To: ARSperl User Discussion
Subject: Re: [Arsperl-users] ars_CreateEntry crashing on Windows
John Unsworth wrote:
> Hello,
>=20
> Can someone explain what happens now? Do we get notified of an=20
> official fix?
>=20
I added this patch to the CVS tree. Since the discussion centered around =
the
bug affecting Windows, I modified the suggested fix to be:
> /* malloc that will never return null */
> void *
> mallocnn(int s)
> {
>=20
> #if defined(malloc) && defined(_WIN32)
> #undef malloc
> #endif
>=20
> void *m =3D malloc(s ? s : 1);
>=20
> if (!m)
> croak("can't malloc");
>=20
> memset(m, 0, s ? s : 1);
>=20
> return m;
> }
>=20
-------------------------------------------------------------------------=
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Arsperl-users mailing list
Ars...@ar...
https://lists.sourceforge.net/lists/listinfo/arsperl-users
|