There are two reasons for this difference:

* Debugger symbols: Palm programs have the option of embedding the names of the

functions that comprise them. The names of the functions appear in memory
directly after the functions themselves. Because C++ typically "mangles"
functions names (that is, adorns the function names with additional characters
that describe the parameter types passed to the function), names generated for
C++ functions will be longer.

You can negate this differences in two ways: (1) Go into the 68K Process
preferences and set Macsbug symbols to "None", or declare all the functions in
your application as 'extern "C"'.

* Runtime library.  For some reason, the runtime startup code included in the
two Startup projects is different.  One version of __Startup__ comes from
StartupCode.c, and the other comes from PalmOS_Startup.c. The latter is more
extensive, and is the one used with the C++ project.

Replacing the runtime library linked with the C++ project with the one linked
with the C project (and making the Macsbug-related changed indicated above)
result in both projects producing identical PRC files.

-- Keith Rollin
-- Palm OS Emulator engineer






Anne Srinivas <[EMAIL PROTECTED]> on 07/06/2000 03:22:26 AM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  Anne Srinivas <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Re: C Vs C++



Thanks for all of u for giving u'r valuable suggestions

If you have Code Warrior ver 6.0 you can do a simple benchmark. Create 2
projects one in C and another in C++ using a new "Palm OS 3.5
Stationery".
Compile and see the sizes of it a  C++ dummy app will take 2817bytes
and a C app will take 1824bytes.

Why is this happening ?

Anne Srinivas wrote:

> I have to port a big app from VC++ to Palm OS.
> The application is a mapping app with lots of map data,routing and so
> on....
>
> I am at a juncture where i have to decide between c and c++.
> If u can give me any link/document/description comparing c and c++ i
> shall be
> very gratefull to u.
>
> I know that
> 1. C++ app takes more memory
> 2 .C++ app is slow on palm
>
> Are there any more reasons why we shouldn't go for c++?
>
> Thanks in advance
>
> Regards,
> --
> Anne Srinivas
> Software Engineer
> InfoTech Enterprises Ltd.
> Plot No 11,Infocity,
> Software Units Layout,
> Madhapur,Hyderabad 33
>
> E-Mail :
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> Tel (Office) : 3100855
> Tel (Resi)   : 3033761

--
Anne Srinivas
Software Engineer
InfoTech Enterprises Ltd.
Plot No 11,Infocity,
Software Units Layout,
Madhapur,Hyderabad 33

E-Mail :
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Tel (Office) : 3100855
Tel (Resi)   : 3033761



--
For information on using the Palm Developer Forums, or to unsubscribe, please

see http://www.palmos.com/dev/tech/support/forums/





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to