Reference Counting

Reference Counting - program is running • Disadvantage...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Reference Counting In reference counting every object has a counter with the number of reference pointing to the object, When the reference count reaches 0 the object is removed. This is the approach used by languages such as Perl and Phyton or C++ with “Smart Pointers”. Advantage: Easy to implement. Incremental (objects are freed while
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: program is running) • Disadvantage: – Slow. Every pointer assignment needs to increase/decreased a reference count. – Unable to free cycles Reference Counting Global Vars Stack Register s Ref=2 Ref=2 Ref=0 Ref=1 Ref=1 Ref=1 Ref=1 Ref=0...
View Full Document

This note was uploaded on 01/30/2012 for the course CS 354 taught by Professor Staff during the Fall '08 term at Purdue.

Page1 / 2

Reference Counting - program is running • Disadvantage...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online