z88dk forums

z80 Development Kit

You are not logged in.

#1 2020-05-21 03:16:12

Juan Luis
New member
Registered: 2020-05-20
Posts: 4

Allocating memory

I'm trying to use malloc function but I can't link the program. The errors are:
Error at file 'malloc.asm' line 16: symbol '_heap' not defined
Errors in source file D:\Documents\blueMSXv282full\Tools\z88dk\lib\config\..\..\\lib\target\msx\classic\msx_crt0.asm:
Error at file 'malloc.asm' line 16: symbol '_heap' not defined

z88dk manual says I have to link with balloc.lib or malloc.lib but these libraries don't exist. I could see that Z88DK_DIR/libsrc contains libraries to make and I'm surprised because I have installed z88dk from precompiled .zip, and I expected all libraries built yet.

- What have I do?

- Must I compile these libraries with z88dk?

If the answer is yes, what is the make tool I have to use?

Offline

 

#2 2020-05-21 12:50:15

dom
Administrator
Registered: 2007-07-15
Posts: 1444
Website

Re: Allocating memory

I think I need to sort out the docs and clean some code up in that area.

There's some presets that you add to the command line to define the size of the heap.

-DAMALLOC -> uses 3/4 of memory between program end and stack for the heap
-DAMALLOC2 -> uses 1/2 of memory between program end and stack for the heap
-DAMALLOC1 -> uses 1/4 of memory between program end and stack for the heap

Offline

 

#3 2020-05-21 14:41:48

Juan Luis
New member
Registered: 2020-05-20
Posts: 4

Re: Allocating memory

dom wrote:

I think I need to sort out the docs and clean some code up in that area.

There's some presets that you add to the command line to define the size of the heap.

-DAMALLOC -> uses 3/4 of memory between program end and stack for the heap
-DAMALLOC2 -> uses 1/2 of memory between program end and stack for the heap
-DAMALLOC1 -> uses 1/4 of memory between program end and stack for the heap

It works fine. Thanks Dom.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson