This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: What's the meaning of those C++ code? Thanks.
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: QiangHuang <jameshq at liverpool dot ac dot uk>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 25 Apr 2003 19:17:28 +0100
- Subject: Re: [ECOS] What's the meaning of those C++ code? Thanks.
- References: <ONEOIJPPOKNBBKJKCGLCEEFMCAAA.jameshq@liv.ac.uk> <1051108350.2110.19.camel@pc-002>
[ Oops sorry, didn't see this reply when I just sent my last mail. Sorry
bout the noise. ]
Bob Koninckx wrote:
On Wed, 2003-04-23 at 16:18, QiangHuang wrote:
any different between " Cyg_Mutex *m = new((void *)mutex) Cyg_Mutex; " and "
Cyg_Mutex *m = new((void *)mutex) Cyg_Mutex( ); "
I don't think so, I am not 100 % sure though. You are aware that these
questions have little to do with eCos and everything with C++, are you ?
Indeed. The crux is that it's just a standard C++ thing. And the fact it
is placement new rather than plain new makes no difference to whether new
Cyg_Mutex or new Cyg_Mutex() is right - it's just C++.
it seems the " void cyg_flag_init(){ Cyg_Flag *t = new((void *)flag)
Cyg_Flag(); t=t; } " (Note: Cyg_Flag( ) (with bracket)) while
"cyg_mutex_init( ){ Cyg_Mutex *m = new((void *)mutex) Cyg_Mutex;" m=m;} (no
bracket here) ?
Don't understand what you're asking here?
I think he's asking why they aren't the same. The answer is that it makes
no difference.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss