[ nice-Bugs-888736 ] linking out of memory - enum value dispatch

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #888736, was opened at 2004-02-01 22:50
Message generated for change (Comment added) made by arjanb
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=888736&group_id=12788

Category: None
Group: None
Status: Open
>Resolution: Later
>Priority: 2
Submitted By: Isaac Gouy (igouy)
>Assigned to: Arjan Boeijink (arjanb)
Summary: linking out of memory - enum value dispatch

Initial Comment:
enum Val { One, Two, Three, Four, Five, Six, Seven, 
Eight, Nine }

void main(String[] args){ 
   disp(One, Two, Three, Four, Five, Six, Seven, Eight, 
Nine);
}

void disp(Val a, Val b, Val c, Val d, Val e, Val f, Val g, 
Val h, Val i){}

disp(One, Two, Three, Four, Five, Six, Seven, Eight, 
Nine){}


   \Nice\Test>nicec --sourcepath .. -a t.jar test
   nice.lang: parsing
   test: parsing
   test: typechecking
   test: generating code
   test: linking

An exception has occured in the compiler
Please fill-in a bug report at the following webpage:
http://sourceforge.net/tracker/?
func=add&group_id=12788&atid=112788

Stack trace:
Exception in thread "main" java.lang.OutOfMemoryError


Nice compiler version 0.9.6 prerelease (build 2004.01.31, 
17:05:23 UTC)

(Also report 888398)




----------------------------------------------------------------------

>Comment By: Arjan Boeijink (arjanb)
Date: 2004-02-02 16:04

Message:
Logged In: YES 
user_id=688815

We know that the linking stage can be slow and memory 
greedy but I think that OutOfMemoryError won't occur in real 
world code. It can't be easily improved so I want to wait with 
optimizing this till the language has stabilized.

The coverage tests are different for enums so that no default 
implementation is required but it cost some more memory.

enum Color {red, blue, yellow}
void foo(Color c);
foo(red) {}
foo(blue) {}
foo(yellow) {}

This code won't pass the coverage test if you replace the 
enum with global constants.

I will keep this one open as a long priority bug.

----------------------------------------------------------------------

Comment By: Isaac Gouy (igouy)
Date: 2004-02-01 22:53

Message:
Logged In: YES 
user_id=536291

OTOH this works fine:

class Val {}
let Val One = new Val();
let Val Two = new Val();
let Val Three = new Val();
let Val Four = new Val();
let Val Five = new Val();
let Val Six = new Val();
let Val Seven = new Val();
let Val Eight = new Val();
let Val Nine = new Val();

void main(String[] args){ 
   disp(One, Two, Three, Four, Five, Six, Seven, Eight, Nine);
}

void disp(Val a, Val b, Val c, Val d, Val e, Val f, Val g, Val h, 
Val i){}

disp(One, Two, Three, Four, Five, Six, Seven, Eight, Nine){}

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=888736&group_id=12788


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.