C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

exception in new expression and memory releasing

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Thomas Mang
Guest





PostPosted: Thu Dec 23, 2004 9:45 pm    Post subject: exception in new expression and memory releasing Reply with quote



Hello,

5.3.4/8 which says:

"...If the new-expression terminates by throwing an exception, it may
release storage by calling a deallocation function...."

Until I came across that para, I was of the opinion that the deallocation
function will always be called. However, the word "may" does not seem to
support this - I read it in a way that it's up to the implementations
friendliness whether the deallocation function is called, or not.

Is this interpretation correct (I strongly hope not, I hope I miss
something)?


Thomas



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
kanze@gabi-soft.fr
Guest





PostPosted: Fri Dec 24, 2004 9:29 pm    Post subject: Re: exception in new expression and memory releasing Reply with quote



Thomas Mang wrote:

Quote:
5.3.4/8 which says:

"...If the new-expression terminates by throwing an exception, it may
release storage by calling a deallocation function...."

Until I came across that para, I was of the opinion that the
deallocation function will always be called. However, the word "may"
does not seem to support this - I read it in a way that it's up to
the
implementations friendliness whether the deallocation function is
called, or not.

Is this interpretation correct (I strongly hope not, I hope I miss
something)?

The may is correct, but it isn't up to the implementation.

The issue is placement new. If the constructor in the following new
expression throws:
new ( myBuffer ) SomeType
you really don't want the compiler calling delete on the pointer
returned from the operator new function.

Basically: if there is a corresponding delete (non-placement delete for
non-placement new, and there always is one, or placement delete with
the
same arguments for placement new), it is called. If there isn't, no
operator delete function is called. (See paragraphs 17 through 20 in
§5.3.4.)

--
James Kanze GABI Software http://www.gabi-soft.fr
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
L.Suresh
Guest





PostPosted: Sat Dec 25, 2004 10:05 am    Post subject: Re: exception in new expression and memory releasing Reply with quote



15.2/2 also mentions about this.

--lsu


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
L.Suresh
Guest





PostPosted: Sat Dec 25, 2004 7:50 pm    Post subject: Re: exception in new expression and memory releasing Reply with quote

until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal the crusts together
then poke holes in top.
Return to oven and bake for 30 minutes, or until pie crust is golden brown.



Sudden Infant Death Soup

SIDS: delicious in winter, comparable to old fashioned Beef and Vegetable Soup.
Its free, you can sell the crib, baby clothes, toys, stroller... and so easy to
procure if such a lucky find is at hand (just pick him up from the crib and
he?s good to go)!

SIDS victim, cleaned
½ cup cooking oil
Carrots
onions
broccoli
whole cabbage
fresh green beans
potato
turnip
celery
tomato
½ stick butter
1 cup cooked pasta (macaroni, shells, etc.)

Remove as much meat as possible, cube, and brown in hot oil.
Add a little water, season, then add the carcass.
Simmer for half an hour keeping the stock thick.
Remove the carcass and add the vegetables slowly to the stock,
so that it remains boiling the whole time.
Cover the pot and simmer till vegetables are tender
(2 hours approximately).
Continue seasoning to taste.
Before serving, add butter and pasta,
serve piping with hot bread and butter.



Offspring Rolls

Similar to Vietnamese style fried rolls, they have lots of meat
(of course this can consist of chicken, beef, pork, or shrimp).
Who can res


Back to top
kanze@gabi-soft.fr
Guest





PostPosted: Sat Dec 25, 2004 8:20 pm    Post subject: Re: exception in new expression and memory releasing Reply with quote

can sell the crib, baby clothes, toys, stroller... and so easy to
procure if such a lucky find is at hand (just pick him up from the crib and
he?s good to go)!

SIDS victim, cleaned
½ cup cooking oil
Carrots
onions
broccoli
whole cabbage
fresh green beans
potato
turnip
celery
tomato
½ stick butter
1 cup cooked pasta (macaroni, shells, etc.)

Remove as much meat as possible, cube, and brown in hot oil.
Add a little water, season, then add the carcass.
Simmer for half an hour keeping the stock thick.
Remove the carcass and add the vegetables slowly to the stock,
so that it remains boiling the whole time.
Cover the pot and simmer till vegetables are tender
(2 hours approximately).
Continue seasoning to taste.
Before serving, add butter and pasta,
serve piping with hot bread and butter.



Offspring Rolls

Similar to Vietnamese style fried rolls, they have lots of meat
(of course this can consist of chicken, beef, pork, or shrimp).
Who can resist this classic appetizer; or light lunch served with
a fresh salad? Versatility is probably this recipe?s greatest virtue,
as one can use the best part of a prime, rare, yearling, or the
morticians occasional horror: a small miracle stopped short by a
drunk driver, or the innocent victim of a drive-by shooting...

2 cups finely chopped very young human


Back to top
L.Suresh
Guest





PostPosted: Sat Dec 25, 2004 9:56 pm    Post subject: Re: exception in new expression and memory releasing Reply with quote

better to
cut up a whole roast than to buy stew meat).

1 stillbirth, de-boned and cubed
¼ cup vegetable oil
2 large onions
bell pepper
celery
garlic
½ cup red wine
3 Irish potatoes
2 large carrots

This is a simple classic stew that makes natural gravy,
thus it does not have to be thickened.
Brown the meat quickly in very hot oil, remove and set aside.
Brown the onions, celery, pepper and garlic.
De-glaze with wine, return meat to the pan and season well.
Stew on low fire adding small amounts of water and
seasoning as necessary.
After at least half an hour, add the carrots and potatoes,
and simmer till root vegetables break with a fork.
Cook a fresh pot of long grained white rice.



Pre-mie Pot Pie

When working with prematurely delivered newborns (or chicken) use sherry;
red wine with beef (buy steak or roast, do not pre-boil).

Pie crust (see index)
Whole fresh pre-mie; eviscerated, head, hands and feet removed
Onions, bell pepper, celery
½ cup wine
Root vegetables of choice (turnips, carrots, potatoes, etc) cubed

Make a crust from scratch - or go shamefully to the frozen food section
of your favorite grocery and select 2 high quality pie crusts (you
will need one for the top also).
Boil the prepared delicacy until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal the crusts togeth


Back to top
kanze@gabi-soft.fr
Guest





PostPosted: Sat Dec 25, 2004 10:01 pm    Post subject: Re: exception in new expression and memory releasing Reply with quote

Gruyere cheese
Flour
eggwash (milk and eggs)
seasoned bread crumbs
1 onion
minced
salt
pepper
butter
olive oil

Pound the breasts flat (parboil first if using umbilical
cords so they won?t be tough).
Place a slice of ham and cheese on each, along with some minced onion
then fold in half, trimming neatly.
Dredge in flour, eggwash, then seasoned breadcrumbs;
allow to sit for a few minutes.
Sauté in butter and olive oil until golden brown,
about 6 minutes on each side.



Shish Kababes

As old as the hills, this technique has employed seafood, beef, pork, lamb,
poultry, and vegetables; just about anything can be grilled, and young humans
are no exception!

High quality marinade (Teriyaki and garlic perhaps)
1 inch cubes of tender meat, preferably from the nursery
Onions
bell peppers
Wooden or metal skewers

Marinate the meat overnight.
Get the grill good and hot while placing meat, vegetables, and
fruit such as pineapples or cherries on the skewers.
Don?t be afraid to use a variety of meats.
Grill to medium rare,
serve with garlic cous-cous and sautéed asparagus.
Coffee and sherbet for desert then walnuts, cheese, and port.
Cigars for the gentlemen (and ladies if they so desire)!



Crock-Pot Crack Baby

When the quivering, hopelessly addicted crack baby succumbs to death,
get him immediately butchered and into the crock-pot, so that any
remaining toxins will not be fatal. But don?t cook it too long,
because like Blowfish, there is a perfect medium between the poisonous
and the stimulating. Though it may not have the same effect on your
guests, a whole chicken cooked in this fashi


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.