• Welcome to Valhalla Legends Archive.
 

Having a pointer freed when the calling function exits

Started by shout, October 06, 2005, 09:46 PM

Previous topic - Next topic

shout

How would I go about creating a function that spits out a pointer to an allocated chunk of memory, then when the calling function exits, free the pointer? I was thinking something like what _alloca() does.

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.


K

well, are you using C or C++? if you're using C++, I would recommend using something like std::auto_ptr or for more flexibility, boost::shared_ptr / boost::shared_array

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

K

Quote from: rabbit on October 07, 2005, 12:25 PM
Is boost paying you or something?

Is there a problem with recommending a free library that accomplishes the result he is looking for?
Do you have anything helpful to add to the discussion or are you just looking to get banned again?

rabbit

Ech..I was just wondering.  You bring it up a lot.  And I'd prefer not to be banned T.T
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.