From: Stephen P. <Ste...@uc...> - 2004-02-16 12:31:19
|
Regular malloc seems to fail too. This is now really confusing. Steve > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On=20 > Behalf Of > Stephen Pick > Sent: 16 February 2004 12:14 > To: Win32 GUI Hackers (E-mail) > Subject: [perl-win32-gui-hackers] safemalloc() not safe? >=20 >=20 > Hi, >=20 > Firstly - what on earth is safemalloc()? It seems to be=20 > documented in old patches to the perl 5.005 API, but not since then. >=20 > Secondly - safemalloc() seems to fail when reserving space=20 > for text label strings in the InsertItem function of=20 > TreeView.xs. The samples/pmx.pl file distributed with the=20 > Win32::GUI 665 PPM is a good example of the crash, just=20 > comment out "use blib" at the start. It probably won't crash=20 > on your machine (since I'm guessing this is dependent on=20 > circumstance). >=20 > The crash varies. Sometimes it is a null pointer assignment=20 > (memory at "0x0000000" could not be "written"). Sometimes it=20 > is an access violation. I don't understand why safefree is=20 > doing this, it's only allocating 3 or 4 bytes of RAM so it's=20 > not like that's a problem. The line is: >=20 > pszText =3D (LPSTR) safemalloc(tlen); >=20 > tlen is defined OK. >=20 > Is there something that we should be using instead of=20 > safemalloc() because safemalloc does not appear to be safe. >=20 > Steve >=20 >=20 > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id438&op=3Dick > _______________________________________________ > Perl-Win32-GUI-Hackers mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers >=20 |