On 7/26/06, Phil M <[EMAIL PROTECTED]> wrote:
On Jul 26, 2006, at 2:23 PM, Peter K. Stys wrote:
> Just an update for the group. Some may recall my agony trying to
> chase down a random crash in my app (msg excerpted below): in a
> nutshell I kept getting frequent crashes in a single function
> during a m.ushort access. The memblock was malloc'd (reasons
> below). When I changed back to allocating via NewMemoryblock,
> after extensive use, no more crashes.
>
> My conclusion: be careful with malloc in RB. For some reason,
> under certain rare circumstances, it will bite you.
Are you checking for NULL on the variable after the call to malloc?
It will fail if there is not enough memory or not enough continuous
memory. That might be the reason.
Of course. The pointers are malloc'd just fine and work throughout
the app, except in this one method, and then throw a bad address
exception occasionally, when a m.ushort access is attempted.
P.
--
-------------------------------------------------------------------------------
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 of this list here:
<http://support.realsoftware.com/listarchives/lists.html>