
1) "XSWAP contexts" are my new "invention" for Arachne 1.60. They allow
instant garbage collection, and I feel this may be new memory allocation
strategy, although it was probably invented thousand times before. 
In the case it is really my invention, I am publishing the idea (not the
code) under GNU public license (www.gnu.org), so no one else has right to 
patent it ;-). So just in the case I haven't reinvented the wheel...
anyway, I don't want the story of LZW algorithm in GIF files to happen
again.

"Open patent": Memory allocation contexts
-----------------------------------------

Traditional memory allocation strategy is to let programmers call 
"malloc(...)" style functions, which allocate memory pages without telling
memory allocation system any details about future usage and deallocation 
of the memory. This means that ANY memory swapping strategy can give only
random, not the best possible results, and garbage collection algorithm, 
invoked by "free(...)" function, needs extra CPU to make the memory 
re-usable again.

XSWAP memory allocation strategy lets programmers to specify context
when allocating memory; later, all memory chunks of certain context can
be de-allocated at once, at very little CPU time cost (it depends only
on number of used memory pages, not on number of items being de-allocated).
Additionaly, different contexts can be given different priority when
storing pages of memory using media with different access speed (eg. RAM 
vs. disk vs. networked memory).

I declare this algorithm to be publicly known, so no one is allowed
to protect this algorithm by patent laws of any country worldwide.
If you will use this algorithm, you are welcome to mention it is 
re-implementation of XSWAP memory allocation strategy used in Arachne WWW
browser. Please contact xchaos@arachne.cz if you are interested.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

2) When running Arachne, '?' key dumps XSWAP debugging info.
This feature is kind of xmas present for Clarence Verge and other 
"advanced Arachnologists", who like to compare page load times, etc. ;-)

Debugging information has format like:

*[s=???, n=???, c=???] (repeated many times) r=???, w=???

where:

* (if present) is number of area (1 or 2) where buffer is currently stored
s is size of buffer in bytes
n is number of items located in this buffer (tables, lines of text, etc.)
r is number of buffers reads (from XMS, EMS or disk)
w is number of written buffers (both r and w will overlow after some time)
c is context; -1 is undefined value, other values follow:

#define CONTEXT_HTML   0
#define CONTEXT_SYSTEM 1
#define CONTEXT_TABLES 2
#define CONTEXT_ICONS  3
#define CONTEXT_TMP    4

The XSWAP debugging info can help to analyze some type of problems, eg.
very slow Arachne operation, etc. You should never actually see "CONTEXT_TMP"
in this listing, and number of items (n) in buffers with CONTEXT_TABLES
should be equal to number of tables in document (for 0 tables, this context
shouldn't be present at all). Number of HTML atoms Arachne reports 
when Alt+M is pressed is NOT identical to number of items in CONTEXT_HTML.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

3) If Arachne crashes with "Illegali xSwap operation" message, please
send the details (module name and line number) to xchaos@arachne.cz