Rios Rivas, Juan Ricardo3; Nilsen, Kelvin4; Schoeberl, Martin3
1 Department of Informatics and Mathematical Modeling, Technical University of Denmark2 Embedded Systems Engineering, Department of Informatics and Mathematical Modeling, Technical University of Denmark3 Department of Applied Mathematics and Computer Science, Technical University of Denmark4 Atego Systems, Inc.
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