[ECOS] Question about "new" operator in C++ and "malloc()" function in C. Thanks a lot

QiangHuang jameshq@liverpool.ac.uk
Wed Jul 30 08:20:00 GMT 2003


Dear all:
       I have this question in mind for a while and I still can't figure it
out. Hope somebody can share me some idea on this question. Thanks a lot.

Question 1:
When using "new" operator in C++ for building eCOS application, no
supporting package is needed while for using "malloc()" function, supporting
package "memalloc" has to be added for building the eCOS library. Those two
are all for memory allocation, so I wonder why "new" doesn't need any other
supporting package while "malloc" does. (Can I guess the reason that: "new"
is a operator, which has been implemented by the C++ compiler while for
"malloc()" is a function, which will need lower level(system related)
function support (from some other library, stdlib?)? )

Question 2:
When compiling/linking a 'C' eCOS application "-nostdlib" need to be
suppiled, but if for 'C++' eCOS appliation do I need to supply any other
directive? Or "-nostdlib" is applied for both 'C' and "C++" built eCOS
appliation (Does this means we can just use C/C++ built in operator for
building eCOS appliation not any other supporting functions?)?

Thanks a lot.

Best regards.

qiang


-- 
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