Designing efficient and safe non-strong references in Eiffel with parametric types
Résumé
In this partial report, we present the current state of our work in 2004 within the SmartEiffel project on the design and implementation of several kinds of object references. We introduce the known concept of weak references, reminding how this peculiar kind of references can be used to optimize and fine-tune the memory behavior of programs, thus potentially speeding up their execution. We show that genericity (parametric types in Eiffel) is the key to implementing weak references in a statically-checked hence safer and more efficient way. We compare our solution for weak references to similar notions in other languages and stress the advantages it offers. We present practical examples to support our claim that weak references can be both safe and efficient, and can help optimize programs memory-wise. We further extend our work to other kinds of references --- soft references, tunable strength references and programmable references --- that provide extra degrees of flexibility and correspond to actual practical needs.
Loading...