c++ auto_ptr garbage collection try catch throw with source for autoDelete

Channel:
Subscribers:
144
Published on ● Video Link: https://www.youtube.com/watch?v=ZDQdkKcWAwE



Duration: 1:16
431 views
2


june 20 2014 see text bubbles in video for corrections .
I started using an enhanced use concept with auto_ptr , but auto_ptr is not flexible enough. So I wrote autoDelete class .
3 source code files in the video main.h man.cpp autoDelete.h
Place autoDelete.h into your normal Include folder of header
files and autoDelete is ready for use, to allocate 1D 2D 3D
arrays all with automatic garbage collection, and we continue to
use a regualr c\c++ pointer to access the heap items, so we get full speed of c\c++ ,. no double de-referencing needed.
autoDelete is NOT a smart pointer . autoDelete is more of an
allocator class that provides automatic garbage collection.
I describe it's use by providing the source code.
main.cpp shows how to use it. I compiled as x64 release .

exception handling try catch throw included .
catch(...) can get bypassed by unexpected() or directly by terminate( ) . The order of calls is:
unexpected( ) calls terminate( ) and terminate( ) calls abort( )

a throw that is NOT in a "throw list" calls unexpected( )
a throw that occures outside of a try block or a throw that is NOT
caught( ) causes a direct call to terminate( ) .

unexpected( ) always calls terminate( ) , and terminate( ) always calls abort( ) .

we can Trap to delegate by using set_unexpected( ) and set_terminate( ) , however, abort( ) will still get called .

The function( ) pointers can only be "c" style . .

abort( ) does NOT allow ~destructors to run .

So, if unexpected( ) or terminate() are CALL'd , we might be
able to Free heap allocations there, with our custom delegate
function( ) . I have had commercial\paid for programs crash with
abort( )\unknown error , and it's best to re-boot no matter what .

unexpected( ) and terminate( ) can be fixed in the source.
remove "throw List" constraints . Place ALL throws from inside a try block . Make any\all legitimate throws to have a matching catch( ) block .




Other Videos By 240mains


2015-04-08Colossus 2 Hauppauge PC HDMI video recorder part 3 , final part
2015-04-01colossus 2 Hauppauge hardware PC HDMI video recorder
2015-04-01colossus 2 Hauppauge hardware with Wolfenstein part 2
2015-03-22introductory circuit analysis distilled part 1 . using passive sign convention
2015-03-2210's complement subtraction
2015-01-08c++ tips , allocations , operator=() , const , exceptions , book list , more
2014-11-265.1 speaker placement using basic trig. Full details included
2014-10-23passive Sign convention more disected updated 5 extra frames 2c
2014-08-18big integer adder Fibonacci Factorial complete source code c++
2014-07-09matrices recursion c++
2014-06-10c++ auto_ptr garbage collection try catch throw with source for autoDelete
2014-03-24perfect pixel alignment using HDMI on windows PC with ATI AMD
2014-02-114k video exposed . HD 4k 8k compared
2014-02-11frequency analysis of transistor amp
2014-01-09transistor current sources basic Wilson Widlar all 3 are current mirrors too.
2013-09-10feedback amplifier complex poles quadratic general solution Casio fx-115 ES Plus
2013-08-30feedback amplifier "Generalized" the A'of closed loop gain equation part 3
2013-08-17feedback amplifier DC analysis thevenize solve for Ro of 2 stage transistor amp
2013-08-12feedback amplifiers based on Microelectronic Circuits second edition
2013-03-21mesh analysis passive sign convention, updated\uploaded march 21, 2013
2013-03-10Z6a audio setup using the SB1095 USB sound card . Turtle Beach , Creative



Tags:
auto_ptr
auto pointer
c++
autoDelete
free source code
exception handling
try catch throw