[ECOS] Question about "new" operator in C++ and "malloc()" function in C. Thanks a lot
Nick Garnett
nickg@ecoscentric.com
Wed Jul 30 14:31:00 GMT 2003
"QiangHuang" <jameshq@liverpool.ac.uk> writes:
> Thanks a lot Nick and Jifl for your reply.
>
> Q1
> as eCOS built with "libtarget.a libgcc.a libsupc++.a". Does the ISO C
> package (in eCOS source) implement all the ISO standard C support?
Probably. Although it is mostly compliant with C89 rather than C99.
> Does
> anyother supporting functions comes from libgcc.a rather than the ISO C
> package? (would this cause any conflict between ISO C package and libgcc.a
> if both supply the function (same name)?) (I am new to the GNU compiler
> library, so please correct me if I am wrong. thanks)
libgcc just contains stuff that the compiler requires. Depending on
the target it may contain things like software floating point
and arithmetic routines. The C library routines are usually in
libtarget.
>
> Q2
> As ISO C support is implemented as a package suppiled with eCOS in source
> form, does "new/delete" opeartor also implemented and suppiled with eCOS in
> source form? or come directly from the libsupc++.a library or as built-in
> with C++ compiler?
>
The standard new is part of the compiler implementation, and is
provided in libsupc++. It ends up calling malloc(), but you would have
to look at the C++ library sources in the compiler sources to see what
else it does.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list