This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: question about "new" overloading function
- From: Bart Veer <bartv at redhat dot com>
- To: nhko at gctsemi dot com
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 7 Mar 2002 14:18:33 GMT
- Subject: Re: [ECOS] question about "new" overloading function
- References: <0F61D7853F0B434A90567901F0D604EF07CBFB@gctsemi.gctsemi.com>
- Reply-to: bartv at redhat dot com
>>>>> "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