• 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: Is it safe to use memset() & memcpy() in my callback?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it safe to use memset() & memcpy() in my callback?


  • Subject: Re: Is it safe to use memset() & memcpy() in my callback?
  • From: Steve gfx <email@hidden>
  • Date: Tue, 5 Oct 2010 22:49:40 +0100

Thanks Paul, glad to hear it. Makes the code easier to read too.

On 5 Oct 2010, at 21:30, Paul Davis wrote:

> On Tue, Oct 5, 2010 at 4:11 PM, Steve gfx <email@hidden> wrote:
>> I've read various dos & don'ts about what is safe to run inside an input Audio Unit  callback.
>> I'm sequencing lots of small sounds which I'm copying from memory in to the callback buffers.
>> Is it safe to use memcpy()  to copy across my buffers, and memset(frameBuffer, 0,  length) to silence the parts of the stream I need to?
>
> memcpy and memset are not blocking operations. they are safe to use in
> any realtime context. its also very useful that setting all 4 bytes of
> a float to zero corresponds to the numerical value of zero, and so
> yes, memset(buf,0,len) works as an easy way to write silence into a
> buffer.

 _______________________________________________
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: 
 >Is it safe to use memset() & memcpy() in my callback? (From: Steve gfx <email@hidden>)
 >Re: Is it safe to use memset() & memcpy() in my callback? (From: Paul Davis <email@hidden>)

  • Prev by Date: Re: Is it safe to use memset() & memcpy() in my callback?
  • Next by Date: AVAudioMix and video
  • Previous by thread: Re: Is it safe to use memset() & memcpy() in my callback?
  • Next by thread: AVAudioMix and video
  • Index(es):
    • Date
    • Thread