Scoped memories are introduced in real-time Java profiles in order to make object allocation and deallocation time and space predictable. However, explicit scoping requires care from programmers when dealing with temporary objects, passing scope-allocated objects as arguments to methods, and returning scope-allocated objects from methods. To simplify the correct usage of scopes, programming patterns may be helpful. We present patterns for simple subroutines, sequences of subroutine calls, and nested calls, where the patterns avoid memory leaks and unnecessary copying of values. The patterns are illustrated by implementations in the safety-critical Java profile.
Proceedings of the 10th International Workshop on Java Technologies for Real-time and Embedded Systems, 2012, p. 1-8
Main Research Area:
10th International Workshop on Java Technologies for Real-time and Embedded Systems (JTRES 2012)International workshop on Java technologies for real-time and embedded systems