Lazy Evaluation of C++ Static Constructors

2Citations
Citations of this article
5Readers
Mendeley users who have this article in their library.

Abstract

Static constructors in C+ + are functions that are executed implicitly to initialize objects at run time. Although a C+ + implementation is allowed to defer the construction of objects defined in a given translation unit until the first use of any function or object defined in that translation unit, most implementations execute all static constructors for the entire program before the invocation of main1992. In this paper, we describe an implementation that defers the execution of static constructors for objects defined by a translation unit in a shared library until the first potential access of any function or object defined in that translation unit. This design relies on the deferred dynamic binding facility provided by the HP-UX shared library implementations. We describe how to modify our design to apply to statically linked programs as well, while avoiding most of the overhead normally associated with dynamic linking. © 1992, ACM. All rights reserved.

Cite

CITATION STYLE

APA

Sabatella, M. (1992). Lazy Evaluation of C++ Static Constructors. ACM SIGPLAN Notices, 27(6), 29–36. https://doi.org/10.1145/130981.130985

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free