This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]