home .. forth .. colorforth mail list archive ..

[ColorForth] memory allocation for windowing


Hi,

With c4w I am going to built an application with a multiple document like interface, that is, there are lots of similar windows (same code different data), which can be open and closed in an *arbitary order*.

What would be the simple yet effective forth way of managing the memory required for each window? Each window is likely to require a different amount of memory, though no window is likely to need more than say 5KB. I can think of the following:

1) Implement multitasking with a separate dictionary for each task. Either:
a) Having completely separate dictionaries and recompiling (or copying, is the machine code fully relocatable?) each dictionary from scratch. b) Having a base dictionary and task dictionary, searching them in order when compiling

2) Choose a maximum number of windows and preallocate that many 5K chunks of memory in the dictionary. If the user doesn't use them all, too bad some memory is wasted. If the user wants more windows, too bad they can't.

3) Implement a linked list based dynamic memory allocation system like is done with mainstream languages.

Until I try all three I doubt I'll have a real appreciation of the issues involved.

Can someone who has done this sort of thing before give me some advice?

Thanks, Richard Collins
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com
Wiki page http://kristopherjohnson.net/wiki/ColorForth
ColorForth index http://www.users.qwest.net/~loveall/c4index.htm