Re: c++
Re: c++
- Subject: Re: c++
- From: Jens Alfke <email@hidden>
- Date: Wed, 11 Feb 2009 07:46:01 -0800
On Feb 11, 2009, at 4:55 AM, Joel Reymont wrote: All of the CoreAudio example code seems to be written in C++. I assume that CoreAudio itself is written in C++ too.
That's not necessarily true — the API is C-based, so the implementation could be written in anything — but I believe you're right. If you look at backtraces of crashes/hangs in CoreAudio, you can see C++ method names.
Is there a particular reason for this? Why not C or Objective-C?
Not C, because they wanted to use object-oriented programming, I presume. (I agree. I would never want to write anything in pure C again.)Not Objective-C, because CoreAudio is pretty low down in the OS stack and has to run in contexts where you don't necessarily want the overhead of the Obj-C runtime or the Foundation framework. Also, Obj-C method dispatch is slightly slower than C++, and that can be significant in highly optimized real-time code. And also^2, the hardware-interface parts of CoreAudio tie into IOKit, which has a C++ API.
—Jens |
_______________________________________________
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
- Follow-Ups:
- Re: c++
- From: Brian Willoughby <email@hidden>
References: | |
| >c++ (From: Joel Reymont <email@hidden>) |