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: IOMalloc question



Hi Tony,

On Apr 30, 2007, at 11:58 AM, Tony Wong wrote:


I am using IOMalloc in a media filter driver to allocate buffer for each read, write request.
Data is copied around.

Everything works fine until I ran a heavy read test.  After a few fairly large read requests
(512K size), IOMalloc fails.  That's fine.  I queue the request up and then the driver retries
the IOMalloc in the IOCompletion routine when some previous IOMalloc'ed buffer is freed.
It works a couple times and then it gets stuck.   Then I added some timeout events to
do the IOMalloc periodically but it just fails.  The test hangs.

I also have the impression that IOMalloc() will block until memory is available.  When does it
ever return NULL?  What does that mean?

Is there other way to allocate memory (I am assuming that IOMalloc has a limited pool??)?

IOMalloc is only for small temporary allocations. Otherwise try IOBufferMemoryDescriptor.

--gc
____________________________________________________________________
Garth Cummings  email@hidden
Sr. Software Engineer
Apple Developer Technical Support


WWDC 2007 • June 11-15 • Moscone West • San Francisco, CA


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to 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.