SlideShare a Scribd company logo
1 of 25
February 28, 2009 Object Lifetime in C/C++ Madhubanti Dasgupta Interra Systems (India) Pvt. Ltd.   Current Practices in Object Oriented Software Development   Meghnad Saha Institute of Technology
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Lifetime Fundamentals Allocation - Deallocation
Object Lifetime Fundamentals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Lifetime Fundamentals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Lifetime Fundamentals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Managed Lifetime
Object Lifetime Fundamentals ,[object Object],[object Object],[object Object],[object Object]
Data Memory Areas System Agnostic View
Data Memory Areas Program Code Text Global / File Scope Objects;  Static Class Scope Objects; Function Scope Objects Static Dynamic Objects managed by new / delete & malloc / free Free Store & Heap Automatic Objects Stack Constant literals including strings Const Data Data Area
Types of Objects Static – Automatic – Dynamic
Static Objects Compiler-Managed Objects in the Global Store
Static Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Static Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Static Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Static Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Execution beyond  main() ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Execution beyond  main() ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Automatic Objects Compiler-Managed Objects in Local Store
Automatic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Automatic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Automatic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Objects User-Managed Objects in the Free Store
Dynamic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank You

More Related Content

What's hot

My first experience with lambda expressions in java
My first experience with lambda expressions in javaMy first experience with lambda expressions in java
My first experience with lambda expressions in java
Scheidt & Bachmann
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
Richa Jain
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
Terry Yoast
 
Multithreading and Parallelism on iOS [MobOS 2013]
 Multithreading and Parallelism on iOS [MobOS 2013] Multithreading and Parallelism on iOS [MobOS 2013]
Multithreading and Parallelism on iOS [MobOS 2013]
Kuba Břečka
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8
Martin Toshev
 

What's hot (20)

Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)
 
JavaFX Dependency Injection with FxContainer
JavaFX Dependency Injection with FxContainerJavaFX Dependency Injection with FxContainer
JavaFX Dependency Injection with FxContainer
 
Java GC
Java GCJava GC
Java GC
 
06.1 .Net memory management
06.1 .Net memory management06.1 .Net memory management
06.1 .Net memory management
 
Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
 
My first experience with lambda expressions in java
My first experience with lambda expressions in javaMy first experience with lambda expressions in java
My first experience with lambda expressions in java
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design pattern
 
Streams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxStreams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to Rx
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrency
 
Keeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacksKeeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacks
 
Iterator
IteratorIterator
Iterator
 
Multithreading and Parallelism on iOS [MobOS 2013]
 Multithreading and Parallelism on iOS [MobOS 2013] Multithreading and Parallelism on iOS [MobOS 2013]
Multithreading and Parallelism on iOS [MobOS 2013]
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
 
Concurrency Utilities in Java 8
Concurrency Utilities in Java 8Concurrency Utilities in Java 8
Concurrency Utilities in Java 8
 
Java Concurrency in Practice
Java Concurrency in PracticeJava Concurrency in Practice
Java Concurrency in Practice
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Threading in iOS / Cocoa Touch
Threading in iOS / Cocoa TouchThreading in iOS / Cocoa Touch
Threading in iOS / Cocoa Touch
 

Similar to Object Lifetime In C C++

Christophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java ExchangeChristophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java Exchange
Skills Matter
 
Padroes Projeto
Padroes ProjetoPadroes Projeto
Padroes Projeto
lcbj
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
LearningTech
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
LearningTech
 

Similar to Object Lifetime In C C++ (20)

Singleton Object Management
Singleton Object ManagementSingleton Object Management
Singleton Object Management
 
Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2
 
ConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTION
 
Constructor & destructor
Constructor & destructorConstructor & destructor
Constructor & destructor
 
Memory management in c++
Memory management in c++Memory management in c++
Memory management in c++
 
More topics on Java
More topics on JavaMore topics on Java
More topics on Java
 
Constructors in C++.pptx
Constructors in C++.pptxConstructors in C++.pptx
Constructors in C++.pptx
 
Constructors & Destructors
Constructors  & DestructorsConstructors  & Destructors
Constructors & Destructors
 
00-intro-to-classes.pdf
00-intro-to-classes.pdf00-intro-to-classes.pdf
00-intro-to-classes.pdf
 
Memory Management In C++
Memory Management In C++Memory Management In C++
Memory Management In C++
 
Christophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java ExchangeChristophe Spring Actionscript Flex Java Exchange
Christophe Spring Actionscript Flex Java Exchange
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
 
Padroes Projeto
Padroes ProjetoPadroes Projeto
Padroes Projeto
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
 
Memory management in Objective C
Memory management in Objective CMemory management in Objective C
Memory management in Objective C
 
iPhone Seminar Part 2
iPhone Seminar Part 2iPhone Seminar Part 2
iPhone Seminar Part 2
 
Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017Design patterns in Java - Monitis 2017
Design patterns in Java - Monitis 2017
 
Constructor destructor.ppt
Constructor destructor.pptConstructor destructor.ppt
Constructor destructor.ppt
 

More from ppd1961

Science & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & CoverScience & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & Cover
ppd1961
 
NDL @ YOJANA
NDL @ YOJANANDL @ YOJANA
NDL @ YOJANA
ppd1961
 
Reconfigurable Computing
Reconfigurable ComputingReconfigurable Computing
Reconfigurable Computing
ppd1961
 

More from ppd1961 (20)

Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel TourLand of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
 
Science & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & CoverScience & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & Cover
 
NDL @ YOJANA
NDL @ YOJANANDL @ YOJANA
NDL @ YOJANA
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Digital geometry - An introduction
Digital geometry  - An introductionDigital geometry  - An introduction
Digital geometry - An introduction
 
Innovation in technology
Innovation in technologyInnovation in technology
Innovation in technology
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depth
 
C++11
C++11C++11
C++11
 
Function Call Optimization
Function Call OptimizationFunction Call Optimization
Function Call Optimization
 
How To Define An Integer Constant In C
How To Define An Integer Constant In CHow To Define An Integer Constant In C
How To Define An Integer Constant In C
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
Technical Documentation By Techies
Technical Documentation By TechiesTechnical Documentation By Techies
Technical Documentation By Techies
 
Vlsi Education In India
Vlsi Education In IndiaVlsi Education In India
Vlsi Education In India
 
Reconfigurable Computing
Reconfigurable ComputingReconfigurable Computing
Reconfigurable Computing
 
Women In Engineering Panel Discussion
Women In Engineering   Panel DiscussionWomen In Engineering   Panel Discussion
Women In Engineering Panel Discussion
 
Handling Exceptions In C & C++[Part A]
Handling Exceptions In C & C++[Part A]Handling Exceptions In C & C++[Part A]
Handling Exceptions In C & C++[Part A]
 
Dimensions of Offshore Technology Services
Dimensions of Offshore Technology ServicesDimensions of Offshore Technology Services
Dimensions of Offshore Technology Services
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 

Object Lifetime In C C++