Stack.java

Maxim Kizub max at immsp.kiev.ua
Fri Aug 21 06:20:48 PDT 1998


Hello.

Looks like java/util/Stack or java/util/Vector classes has bugs, or
are improperly implemented.

I use JavaCC for my compiler, in fact - both jjtree & javacc.
The code generated by jjtree (AST tree generator for JavaCC)
heavy uses java/util/Stack class. After a while, it crashes
my compiler with ArrayIndexOutOfBoundsException on pop->peek
operation. I've inserted a check like

if( !nodes.empty() ) return nodes.pop()
else return null;

This does not help. I've inserted

if( nodes.size() != 0 ) return nodes.pop()
else return null;

This does not helps. So, looks like the bug is that
index of top element is _greater_, then elementCont
of vector.

I've unpacked these Sun's classes and placed them in
classpath before Klasses.jar - the compiler started
to work fine. So, there is a bug or incompatibility
with java/util/Stack of kaffe distribution.

Well, after the replasment of Stack I started to
check the kaffe. First impression - it uses 20 Mb
RAM to only start my compiler. Strange. Well, while
compiling files with medium size and above - OutOfMemory.
Is there any plans to improve memory usage?
Do you use malloc?

Next, when I try to recompile the full project -
kaffe crashes because of assertions. I think - this
is OK, since I've compiled kaffe from latest snapshort ;-)

PS Ah, the platform is Windows95. Cygnus beta 19.

-- 
Maxim Kizub, Forestro
mailto:maxim at forestro.com mailto:max at immsp.kiev.ua
Visit Kiev language homepage http://forestro.com/kiev/


More information about the kaffe mailing list