-
December 1st, 2010, 12:28 PM
#16
Re: Tasteless mimic of operator new: Call ctor
Lindley, I can't add to your rep any more because the box won't let me. Wants me to spread it around.
But you rock. All the other gurus too.
Bye, Chris.
You're gonna go blind staring into that box all day.
-
December 1st, 2010, 04:06 PM
#17
Re: Tasteless mimic of operator new: Call ctor
Originally Posted by dude_1967
There will be no corresponding calls to delete in these designs.
When you use placement new, you shouldn't call delete, but you should call the destructor explicitly.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
December 1st, 2010, 04:44 PM
#18
Re: Tasteless mimic of operator new: Call ctor
Well, placement delete. However, that isn't necessary if the types in question don't allocate resources internally, which may be the case here.
-
December 2nd, 2010, 04:03 AM
#19
Re: Tasteless mimic of operator new: Call ctor
Thanks for the further suggestions.
The types I am creating with placement new never delete. They also don't alocate any further resources internally.
It's kind of a funny region --- the world of tiny embedded systems. You turn on your microcontroller, initialize your CPU, stack-pointer, hardware, SRAM, stack, ctors, etc. Then you might make your singleton instances, as run-time progresses, with placement new.
The microcontroller runs and runs and runs until someone mercifully switches it off. main does not return. It's a different kind of design than most people are used to. For this design, I am making a kind of "one-shot" heap.
I've got it all under control now.
Again, thanks for all the help. I always get good answers at codeguru.
Sincerely, Chris.
You're gonna go blind staring into that box all day.
-
December 2nd, 2010, 04:05 AM
#20
Re: Tasteless mimic of operator new: Call ctor
This article by Dr Dobbs may be of some use or inspiration.
http://www.drdobbs.com/184403759
I used information from here to help design allocators that grabbed space from the stack.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
December 2nd, 2010, 04:12 AM
#21
Re: Tasteless mimic of operator new: Call ctor
Originally Posted by dude_1967
It's kind of a funny region --- the world of tiny embedded systems.
Up until my current job all my work was with embedded systems (6809, 68000). I used to quite enjoy it. There was no OS; If you wanted to print to the screen you had to first write the code that took the output from printf and wrote the pixels to the video memory from your own bitmap font definitions. Ah, those were the days.. (Sits back in chair basking in warm rosey glow of nostalgia )
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|