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]

Re: question about "new" overloading function


>>>>> "Tony" == Tony Ko <nhko@gctsemi.com> writes:

    Tony> Look at code below, this code is from kapi.cxx. I wonder
    Tony> about HOW this "new" operate.

    <snip>

This is standard C++ syntax, the placement new operator. I suggest
looking this up in a suitable C++ manual, for example my copy of
Stroustrup's "The C++ Programming Language", 3rd edition, describes
placement new in section 10.4.11.

The particular usage within the eCos kernel is just to tell the
compiler that the kernel object should be placed at the specified
location in memory, rather than dynamically allocated from some sort
of heap. Dynamic memory allocation within an embedded kernel is
usually a bad idea.

Bart

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