Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 30th, 2008, 5:45 AM   #1
Rajkumar
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 Rajkumar is on a distinguished road
placement new!!??

can somebody give a clear picture on placement new operator ...and how is it different from the 'regular' new in terms of application and memory pools? some sample codes please...
Rajkumar is offline   Reply With Quote
Old Jan 30th, 2008, 5:57 AM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 489
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: placement new!!??

placement new you write your own new operator
Ancient Dragon is offline   Reply With Quote
Old Jan 30th, 2008, 6:06 AM   #3
Rajkumar
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 Rajkumar is on a distinguished road
Re: placement new!!??

but when n why would I do that... Is the heap allocated any different?
Rajkumar is offline   Reply With Quote
Old Jan 30th, 2008, 7:41 AM   #4
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 489
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: placement new!!??

more info

>>Is the heap allocated any different?
The heap is normally not used for that because the memory returned by placement new comes from some pre-allocated memory block.
Ancient Dragon is offline   Reply With Quote
Old Jan 30th, 2008, 8:13 AM   #5
Rajkumar
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 Rajkumar is on a distinguished road
Re: placement new!!??

oh is it?? I was under a perception that it is yet another kind of DMA. ok thanks bro, I'll look into it n come bac tomorrow.
Rajkumar is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
X,Y placement in console mrynit C++ 13 Mar 13th, 2006 9:35 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC