On 7/28/05 2:40 PM, Matt Gough didst favor us with:
>
> On 28 Jul 2005, at 17:43, Laurence Harris wrote:
>
>>> HLock((Handle)alias);
>>> BlockMove(yourData, *alias, sizeOfYourData);
>>> HUnlock((Handle)alias);
>>>
>>
>> FWIW, you don't need to lock handles in Mac OS X. They never move unless you
>> grow them, and even then only if you grow them beyond their original size.
>>
>
> So how exactly would you grow it without it ending up bigger than the
> original size ;)
You shrink it with SetHandleSize() first.
h = NewHandle( 1000 );
SetHandleSize( h, 100 );
SetHandleSize( h, 1000 ); <- no allocation necessary.
Making a handle smaller doesn't actually release memory in Mac OS X, so if
you regrow it to anything <= the original size, it doesn't need to
reallocate and hence doesn't move.
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden