🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1374

NXZoneMalloc is your friend... NXBitmapImageRep is not.

#1374
From: Brian C. Hobbs
Date: Sat, 07 Nov 1992 00:33
30 lines
1550 bytes
Greetings,

Just a curious question:  Are developers experiencing more memory  
corruption errors of bugs (i.e. invalid memory access, writing over  
existing data, etc...) using 3.0 than 2.1?  It seems that I've got to  
explicitly NXZoneMalloc off everything I do just so the memory is there  
and protected.

Also... this is more of an "intuition" thing... I've talked to NeXT about  
it but I don't know if it's valid and I can't give any examples here:   
I've had some corruption problems using [[NXBitmapImageRep alloc]  
initData:NULL ...] different times on multiple machines on multiple apps  
that I'm writing.  However, if I malloc the memory myself and pass the  
pointer to initData, the problem goes away. (nifty methods, +sizeImage:  
and such.)

The moral of this story:

Don't be lazy.  NXZoneMalloc off everything you can.  Especially on large  
sections of memory like images.  Stay away from:

unsigned char imageData[justHowMuchCanIPutInHereAnyways:)]

Brian Hobbs
Chromagrafx Imaging Systems
brian@chromagrafx.com

"NXZoneMalloc and NXBitmapImageRep.  Use them together.  Use them in  
peace."
Technical Details
Message-ID: <1992Nov7.003348.343@chromagrafx.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!psinntp!psinntp!cgrafx!brian

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!psinntp!psinntp!cgrafx!brian
From: brian@chromagrafx.com (Brian C. Hobbs)
Subject: NXZoneMalloc is your friend... NXBitmapImageRep is not.
Message-ID: <1992Nov7.003348.343@chromagrafx.com>
Sender: brian@chromagrafx.com
Organization: Chromagrafx Imaging Systems, Hauppauge, NY
Date: Sat, 7 Nov 1992 00:33:48 GMT
Lines: 30