Title
Garbage collection in the next C++ standard
Abstract
C++ has traditionally relied on manual memory management. Sometimes this has been augmented by limited reference counting, implemented in libraries, and requiring use of separate pointer types. In spite of the fact that conservative garbage collectors have been used with C for decades, and with C++ for almost as long, they have not been well-supported by language standards. This in turn has limited their use. We have led an effort to change this by supporting optional "transparent" garbage collection in the next C++ standard. This is designed to either garbage collect or detect leaks in code using normal unadorned C++ pointers. We initially describe an ambitious effort that would have allowed programmers to explicitly request garbage collection. It faced a number of challenges, primarily in correct interaction with existing libraries relying on explicit destructor invocation. This effort was eventually postponed to the next round of standardization. This initial effort was then temporarily replaced by minimal support in the language that officially allows garbage collected implementations. Such minimal support is included in the current committee draft for the next C++ standard. It imposes an additional language restriction that makes it safe to garbage collect C++ programs. Stating this restriction proved subtle. We also provide narrow interfaces that make it easy to both correct code violating this new restriction, and to supply hints to a conservative garbage collector to improve its performance. These provide interesting implementation challenges. We discuss partial solutions.
Year
DOI
Venue
2009
10.1145/1542431.1542437
ISMM
Keywords
Field
DocType
initial effort,ambitious effort,normal unadorned c,language standard,minimal support,conservative garbage collector,next c,new restriction,additional language restriction,garbage collection,memory management,c,garbage collector,reference counting
Pointer (computer programming),Garbage,Programming language,Manual memory management,Computer science,Real-time computing,Reference counting,Garbage collection,Garbage in, garbage out,Ephemeron,Memory leak
Conference
Citations 
PageRank 
References 
3
0.46
11
Authors
2
Name
Order
Citations
PageRank
Hans Boehm163238.83
Mike Spertus230.46