RFE: permit allocation of new objects on stack

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.4.1
    • Component/s: specification
    • 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)
      ======================================================================

            Assignee:
            Alex Buckley
            Reporter:
            Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: