Hallo Herr TK Chia,

am Freitag, 24. August 2018 um 18:52 schrieben Sie:
Hi all,

I think I found the cause for command crashing:

the size to swap out, and back in, is only calculated once  in
   XMSinit() {
   ...
   mcb = MK_SEG_PTR (struct MCB, SEG2MCB (_psp));
   xms_block_size = SwapTransientSize = mcb->mcb_size;


now if the size of command.com in memory ever changes,
to little is saved/restored.

unfortunately (thanks TK CHIA) sbreak() tries to increase the
size for malloc'ed memory. if it succeeds (and needed memory
is located behind  SwapTransientSize: BAMM!

second observation:
DOSalloc(size,0) for strings puts DOS allocated memory immediately
behind command.com, preventing sbreak() from growing allocated memory,
--> somewhat better.

third observation: malloc() and sbreak() implementation will vary from
compiler to compiler, so it makes some sense to have fairly 'random'
behaviour.


I'm writing this after just thinking about the issue; no access to a
decent test machine. will test tomorrow or Tuesday.

Tom
        .






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to