-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.4.1
-
x86
-
windows_nt
Name: rmT116609 Date: 01/28/2003
A DESCRIPTION OF THE PROBLEM :
In java, most particularly in GUI programming, one frequently allocates large numbers of small objects which are only used in a local scope. The new garbage collection algorithm goes a considerable way toward solving the performance problems associated with this. However, perhaps the language could support allocating variables on the call stack, perhaps implemented internally with another stack parallel to the call stack.
I suggest:
1) That allocation on stack be introduced by adding the "transient" modifier to the "new" keyword
Object foo = new transient Bar();
2) That it be a *run-time* error to assign a transient reference to an instance variable
3) That it be possible to mark classes at compile time as not accepting transient references as method arguments. This prevents existing libraries being broken by being passed arguments that will throw exceptions that existing
code does not expect.
(Review ID: 180494)
======================================================================
A DESCRIPTION OF THE PROBLEM :
In java, most particularly in GUI programming, one frequently allocates large numbers of small objects which are only used in a local scope. The new garbage collection algorithm goes a considerable way toward solving the performance problems associated with this. However, perhaps the language could support allocating variables on the call stack, perhaps implemented internally with another stack parallel to the call stack.
I suggest:
1) That allocation on stack be introduced by adding the "transient" modifier to the "new" keyword
Object foo = new transient Bar();
2) That it be a *run-time* error to assign a transient reference to an instance variable
3) That it be possible to mark classes at compile time as not accepting transient references as method arguments. This prevents existing libraries being broken by being passed arguments that will throw exceptions that existing
code does not expect.
(Review ID: 180494)
======================================================================
- duplicates
-
JDK-8061404 A Proposal for User-Defined Lightweight Value-Semantics Objects
-
- Closed
-
- relates to
-
JDK-4820062 Provide "struct" syntax in the Java language
-
- Closed
-
-
JDK-6336351 Stack allocations
-
- Closed
-