[comp.sys.m6809] OS-9 windows Get/Put Buffers

jimomura@lsuc.uucp (Jim Omura) (05/25/88)

     This is going to be pretty obvious, but nobodies mentioned
it yet, so I might as well:

     The OS-9 manual says, as best as I can figure out, that you
can't allocate more than 8K in a Get/Put Buffer Group.  As such
my programs are running blocks of 4 *Groups* of buffers at a time
in order to buffer whole screens.  The manual recommends that you
use the User ID (UID) to determine a buffer Group number.  This
is obviously not practical if you have 2 or more programs
running that need their own buffer groups.  As such, I recommend
what I expect most of are probably going to do anyway.

     Forget about the UID.  It's pointless.  Start with group 1
and assume that in any group, the first buffer used will be
Buffer #1.  So walk up the list from Group 1, Buffer 1 and
check the groups to see if they are already used.  This can
be done with the DfGPBuf() call (I think I have the name right
but you'll know it when you look for it . . .).  That call
returns -1 if the Buffer is already allocated.  Keep incrementing
the Group number until you hit an unused Group.  In my case,
I have to go further and check the next 3 Groups as well, but
the principal is the same.

     So, the first "standard" to practice is obviously *always*
use Buffer 1 as the first buffer you define in any group.
The second is always start at Group 1 and your search.

     For the high buffer numbers, I'm currently using 199
for Cursors and I expect to use 198 down to 195 for fonts.
These I'll usually have as "standard system usage" available
to any program that has user definables.  But the lower
Groups (sorry, I should have said "high Group numbers"
above) I presume that the buffers will all be killed before
a program exits.

     So the third recommendation is too keep 195 - 199
for these usages since it makes it possible to avoid reloading
the my User Defined cursors and fonts all the time.  I haven't
got a feeling for whether the "patterns" are going to be
useful yet, so I have no recommendation in that regard.

     Also, I don't know what was intended for the "clipboard"
yet.  I would recommend looking into the Amiga's Arexx
language and what they're doing with their similar "clipboard"
buffers.  Any other suggestions?

Cheers! -- Jim O.
-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
ihnp4!utzoo!lsuc!jimomura
Byte Information eXchange: jimomura