• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Blocks in render callbacks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Blocks in render callbacks


  • Subject: Re: Blocks in render callbacks
  • From: Mark Pauley <email@hidden>
  • Date: Tue, 01 May 2012 14:09:44 -0700

I believe you only have to worry about the obj-c layout of the object when you call Block_copy and Block_release or when you send obj-c messages to the block.

Novocaine (3rd party framework) uses blocks from the audio callback with no problems as far as I know.


On May 1, 2012, at 1:38 PM, "Stephen F. Booth" <email@hidden> wrote:

>>> I know that it is not safe to use the dispatch_* family of functions inside a render callback because they can allocate memory (http://lists.apple.com/archives/coreaudio-api/2011/Jun/msg00141.html).  However, is it acceptable to call a copied block from within a render callback?  Assuming the code within the block doesn't block the thread, allocate memory, call objective-c code or do any of the other "bad" things, is there anything inherent in the block calling mechanism itself that would preclude its use?
>>
>> I don't believe so. A block invocation is just an indirect function call.
>
> That is my hope, but since in Objective-C a block is an actual object
> with an isa pointer I was concerned that there could be some
> behind-the-scenes magic going on.
>
> Stephen
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Blocks in render callbacks (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Re: Blocks in render callbacks
  • Next by Date: Audio session confusion
  • Previous by thread: Re: Blocks in render callbacks
  • Next by thread: Audio session confusion
  • Index(es):
    • Date
    • Thread