[kaffe] Help with Heap Allocation Functions
wyattaw at optushome.com.au
Sat Feb 8 15:16:02 PST 2003
Greetings, fellow kaffe drinkers.
I am trying to make kaffe 1.0.7 run on the m68k, under AmigaOS
3.9. It is supposed to run, but doesn't, for a number of reasons. I
guess the Amiga configuration has been left untested for some time.
I am configuring/compiling/testing it in a Geek Gadgets environment,
using gcc 2.95.2. I have already installed, built and tested gmp-4.1
successfully, so something works.
First question: I've managed to get the whole kaffe suite to compile
and build by editing some Makefile's and the config.h file. The
changes were necessary to repair some syntax errors in the m68k
Makefiles and correct some processor options. But when I run the
/test/regression tests, a few run without error, but most trap out with
"Failed assertion 'block->avail > 0'"
For HelloWorldApp, the trap happens right after a request for a block
of size 32776 bytes (the first request > 32768). The address of the
block returned seems crazy, being in the middle of the range of
already-allocated memory. Suffice it to say that there is no valid gc-
block in the vicinity.
I have the same build on an x86 Linux machine, and it runs fine. I
can even compare the memory requests and identify the same
request on the Linux side - it returns with a reasonable pointer and
works. I have been trying to compare the behaviour of the two
systems, but I don't understand the structure of the heap or the
blocks that are allocated.
As a test, I commented-out the "PREDEFINED_NO_OF_TILES" in
gc-mem.c and rebuilt it. It then trapped out with the error:
"Failed assertion 'currentjThread == lastThread'"
It would seem likely that there is a 16-bit integer problem here
somewhere. I have checked the gcc options and the code generated
in likely places - all seem to use 32-bit arithmetic. Has anyone any
insight, or is there some in-depth documentation available for this
area of code (mem/gc-mem.c)?
Second question: Just running HelloWorldApp generates about
26,000 memory allocation requests during execution. Is this
extraordinary overhead normal?
More information about the kaffe