A word of caution tho: I used malloc because I needed >1GB pointers, which resulted in random crashes that took me many months to track down. I went back to NewMemoryblock (and used arrays of <=1GB pointer instead) and the crashes disappeared. I never figured out why, but it was a statistical process of elimination that was extremely painful.
My lesson: don't use anything but NewMemoryblock in the RB app (using malloc and vec_malloc in plugins is fine). P. On 4/20/07, Frank Condello <[EMAIL PROTECTED]> wrote: > On 20-Apr-07, at 8:53 AM, [EMAIL PROTECTED] wrote: > > > > El 20/04/2007, a las 6:23, Frank Condello escribió: > > > >> I'm pretty sure NewPtr calls down to malloc eventually (in newer > >> versions of OS X at least) but it might do some other nasty stuff for > >> backwards compatibility. Regardless, I don't foresee ever needing > >> allocations of that size - I just need guaranteed alignment. > >> > >> Frank. > >> <http://developer.chaoticbox.com/> > >> <http://macgameblog.com/> > >> > >> On 19-Apr-07, at 10:01 PM, Peter K. Stys wrote: > >> > >>> I believe NewMemoryblock uses Apple's NewPtr call so you can check > >>> there (I had a problem with 1GB block limits and this was the > >>> reason; > >>> malloc has no such limit, or at least 2-4GB, ASFAIK) > >>> > >>> Peter. > >>> > >>> On 4/19/07, Frank Condello <[EMAIL PROTECTED]> wrote: > >>>> I've started declaring into Accelerate.framework and have read that > >>>> Mac OS X's malloc always uses 16-byte alignment, but I was > >>>> wondering > >>>> if I could rely on this alignment from an RB-supplied > >>>> MemoryBlock. I > >>>> know this has been discussed before but I couldn't find a > >>>> definitive > >>>> yes or no - I suspect (and hope) the answer is yes, if not, I've > >>>> got > >>>> a bit more work to do! > >>>> > >>>> TIA, > >>>> Frank. > > > > Not sure if it helps...... but in http://www.nilobject.com/page/3/ > > can I read: > > "On Mac OS X malloc automatically aligns 16 bytes and pads out > > allocations to 16-byte offsets.....:" > > Apple's docs state that clearly as well, but it doesn't guarantee > that RB's memoryblock is always aligned. I suspect RB's memoryblock > *is* aligned on Mac OS X but the lack of a definitive answer drove me > to write my own light weight memoryblock class last night. Problem > solved... > > Thanks to everyone for their input! > > Frank. > <http://developer.chaoticbox.com/> > <http://macgameblog.com/> > > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> > -- ------------------------------------------------------------------------------- Peter K. Stys, MD Professor of Medicine(Neurology), Senior Scientist Ottawa Health Research Institute, Div. of Neuroscience Ottawa Hospital / University of Ottawa Ontario, CANADA tel: (613)761-5444 fax: (613)761-5330 http://www.ohri.ca/profiles/stys.asp ------------------------------------------------------------------------------- _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
