Borrow, copy or steal?: loans and larceny in the orthodox canonical form

Dynamic memory management in C++ is complex, especially across the boundaries of library abstract data types. C++ libraries designed in the orthodox canonical form (OCF) alleviate some of the problems by ensuring that classes which manage any kind of heap structures faithfully copy and delete these. However, in certain common circumstances, OCF heap structures are wastefully copied multiple times. General reference counting is not an option in OCF, since a shared body violates the intended value semantics; although a copy-on-write policy can be made to work with borrowed heap structures. A simpler ownership policy, based on larceny, allows low-level memory manager objects to steal heap structures from temporary variables, in properly isolated circumstances. Various strategies for regulating theft are presented, ranging from pilfer-constructors to locks on heap data. Larceny has similarities with other transfer of ownership patterns, but is more a core implementation technique designed to improve the efficiency and effectiveness of OCF-conformant libraries.

[1]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[2]  Sanford M. Orlow,et al.  Data abstraction and object-oriented programming in C++ , 1990 .

[3]  Daniel M. Yellin,et al.  Hermes - a language for distributed computing , 1991, Prentice Hall series in innovative technology.

[4]  Scott Meyers,et al.  Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) , 1991 .

[5]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[6]  John Hogg,et al.  Islands: aliasing protection in object-oriented languages , 1991, OOPSLA '91.

[7]  Richard C. Holt,et al.  The Geneva convention on the treatment of object aliasing , 1992, OOPS.

[8]  Grady Booch,et al.  Object-oriented analysis and design with applications (2nd ed.) , 1993 .

[9]  Chris Dollin,et al.  Object-oriented development: the fusion method , 1994 .

[10]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[11]  Cay S. Horstmann Mastering object-oriented design in C++ , 1995 .

[12]  James O. Coplien,et al.  Pattern languages of program design , 1995 .

[13]  T. Cargill Localized ownership: managing dynamic objects in C++ , 1996 .

[14]  Naftaly H. Minsky Towards Alias-Free Pointers , 1996, ECOOP.

[15]  Marshall Brain,et al.  Developing Professional Applications in Windows 95 and Nt Using Mfc , 1996 .

[16]  Roy H. Campbell,et al.  Resource exchanger: a behavioral pattern for low-overhead concurrent resource management , 1996 .

[17]  Stanley B. Lippman C++ gems , 1996 .

[18]  Marshall Brain,et al.  Developing Professional Applications; For Windows 95 and NT Using MFC, with CD-ROM , 1996 .

[19]  Doug Lea The GNU C++ library , 1996 .

[20]  Michael J. Vilot,et al.  Standard template library , 1996 .

[21]  Doug Lea,et al.  Concurrent programming in Java - design principles and patterns , 1996, Java series.

[22]  James Coplien,et al.  Advanced C++ Programming Styles and Idioms , 1991, Proceedings. Technology of Object-Oriented Languages and Systems, TOOLS 25 (Cat. No.97TB100239).

[23]  Paulo Sérgio Almeida Balloon Types: Controlling Sharing of State in Data Types , 1997, ECOOP.

[24]  Alexander A. Stepanov,et al.  C++ Standard Template Library , 2000 .