• 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: Objective C and C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C and C++


  • Subject: Re: Objective C and C++
  • From: "tahome izwah" <email@hidden>
  • Date: Mon, 22 Dec 2008 09:03:13 +0100

I'm not 100% sure if this is really true (and I don't have time to
double check) but if it is it probably won't make any difference in
practice. If all you do is call CoreAudio, either through the C API or
using your own/Apple's C++ accessors/abstractions this overhead is
immaterial.

Also, talking about Cocoa now, most objects are toll free bridged so
you can actually access them in C/C++ with zero overhead.

As for the C++ symbol name mangling, you can easily avoid that by
making sure you export your symbols as C.

HTH
--th


2008/12/22 Brian Willoughby <email@hidden>:
> AudioStreamBasicDescription is merely a struct, and it carries no enforced
> behavior with it.  As Bill often points out when someone here has a problem
> creating a valid AudioStreamBasicDescription, CAStreamBasicDescription is a
> C++ object which carries code with it that will create consistent field
> values for you.  You don't get any of that automatic help if you're not
> using C++.  It's not impossible to get it right on your own, but you'll get
> little support if you take that route.
>
> As for mixing C++ and ObjC with no problems and no overhead, that's not
> exactly true.  If all of your code is compiled in one project, that's
> probably not a problem.  However, if you are trying to create a Framework
> for audio, and you want to support ObjC and Standard C for projects which do
> not involve any C++ at all, then you get into a situation where your headers
> and ObjC objects cannot reference any C++ objects, or else the C++
> name-mangling will destroy certain clients of your Framework.
>
> Also, C++ does have a certain amount of hidden overhead in its compile-time
> code generation.  ObjC shifts this sort of thing to the run-time, but ObjC++
> has both the compile-time code generation overhead of C++ and the run-time
> overhead of ObjC.  It's not the sort of thing that affects every program
> written in ObjC++, but it's a far cry from "zero overhead."  Again, the
> overhead is quite minimal, but it is not non-existent.
>
> Brian Willoughby
> Sound Consulting
>
>
 _______________________________________________
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: 
 >Objective C and C++ (From: Brian Hughes <email@hidden>)
 >Re: Objective C and C++ (From: Marc Vaillant <email@hidden>)
 >Re: Objective C and C++ (From: NickMtl <email@hidden>)
 >Re: Objective C and C++ (From: Brian Willoughby <email@hidden>)
 >Re: Objective C and C++ (From: "tahome izwah" <email@hidden>)
 >Re: Objective C and C++ (From: Brian Willoughby <email@hidden>)

  • Prev by Date: Re: Objective C and C++
  • Next by Date: Re: playing audio files separated by specified time intervals
  • Previous by thread: Re: Objective C and C++
  • Next by thread: Re: Objective C and C++
  • Index(es):
    • Date
    • Thread