Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a Handle from an existing memory



On Jun 12, 2007, at 2:12 AM, Yaron Tadmor wrote:

But I still believe the idea behind what I'm looking for is perfectly
valid. The internals of a Handle could very well include an memory
ownership bit, which tells the system whether to deallocate or not. And
then a function like my proposed MemoryToHandle (or more appropriately
WrapMemoryByHandle) would make perfect sense.

The idea could be valid, but it still doesn't match the implementation, which is really the bottom line here. The Memory Manager was written (in the early '80s) to allocate blocks in a fixed- sized heap on a computer with very little memory by today's standards. Handles were a method of providing an indirect reference to a block of memory that might need to be moved due to block resizing, compacting the heap, etc. It doesn't support using memory outside the heap.


For your situation, it sounds like it would just be easiest to allocate a handle of the required size and use it as is, vs providing a static or stack-based block to point to...

steve

_______________________________________________
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
References: 
 >RE: Creating a Handle from an existing memory (From: "Yaron Tadmor" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.