Portable run-time type description for conventional compilers

  • Authors:
  • Sheetal V. Kakkad;Mark S. Johnstone;Paul R. Wilson

  • Affiliations:
  • Department of Computer Sciences, The University of Texas at Austin and Somerset Design Center, Motorola, Inc., Austin TX;Department of Computer Sciences, The University of Texas at Austin and Somerset Design Center, Motorola, Inc., Austin TX;Department of Computer Sciences, The University of Texas at Austin and Somerset Design Center, Motorola, Inc., Austin TX

  • Venue:
  • Proceedings of the 1st international symposium on Memory management
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many useful programming language extensions and system support libraries require knowledge of the locations of fields within objects at run time. Examples include orthogonal persistent object stores, precise garbage collectors, data structure picklers, and parameter marshaling schemes.For clean and efficient implementation as libraries, these systems require run-time knowledge of in-memory layouts of data objects, which is unavailable in most traditionally compiled and linked programming languages, such as C, C++, and Ada. Even the recently standardized run-time type identification (RTTI) feature in C++ is insufficient, because it describes only language-level features of the type hierarchy and not the compiler-dependent object layout decisions.We present a facility for run-time type description, or RTTD, which extracts low-level layout information from debugging information generated by conventional compilers, and makes it available to user programs. We believe this to be the simplest and most portable approach to run-time type description, requiring no changes to existing compilers. In this paper, we describe the basic strategies and present details of our implementation for C++. We also sketch some extensions that we have implemented, including special treatment of C++'s virtual function table pointers to match persistent or foreign data objects with the actual code in a particular application.Our implementation of run-time type description is freely available. It is in regular use with multiple operating systems and compilers, in both free and commercial products, including a high-performance persistent object storage system for C++ and a real-time garbage collector.