Simple garbage-collector-safety
Author:
Open Access
- 1 May 1996
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 31 (5) , 89-98
Abstract
A conservative garbage collector can typically be used with conventionally compiled programs written in C or C++. But two safety issues must be considered. First, the source code must not hide pointers from the garbage collector. This primarily requires stricter adherence to existing restrictions in the language definition. Second, we must ensure that the compiler will not perform transformations that invalidate this requirement.We argue that the same technique can be used to address both issues. We present an algorithm for annotating source or intermediate code to either check the validity of pointer arithmetic in the source, or to guarantee that under minimal, clearly defined assumptions about the compiler, the optimizer cannot "disguise" pointers. We discuss an implementation based on a preprocessor for the GNU C compiler (gcc), and give some measurements of program slow down.Keywords
This publication has 11 references indexed in Scilit:
- Efficient detection of all pointer and array access errors1994
- Collecting more garbage1994
- Concurrent replicating garbage collection1994
- Space efficient conservative garbage collectionACM SIGPLAN Notices, 1993
- Compiler support for garbage collection in a statically typed languageACM SIGPLAN Notices, 1992
- Integrating the Scheme and C languages1992
- Tag-free garbage collection for strongly typed programming languagesACM SIGPLAN Notices, 1991
- Mostly parallel garbage collectionACM SIGPLAN Notices, 1991
- Experiences creating a portable cedarACM SIGPLAN Notices, 1989
- Garbage collection in an uncooperative environmentSoftware: Practice and Experience, 1988