delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/04/14/12:46:40

Date: Sun, 14 Apr 1996 18:45:54 +0200
Message-Id: <199604141645.SAA27419@tyr.diku.dk>
From: Morten Welinder <terra AT diku DOT dk>
To: dj AT delorie DOT com
CC: djgpp-workers AT delorie DOT com
In-reply-to: <199604130233.WAA04438@delorie.com> (dj@delorie.com)
Subject: Re: new write.c

What are the chances of the transfer buffer _not_ being aligned
on a paragraph?  Aren't we just wasting time doing "& 15" all
other the library?

Another thing: is it valid for _any_ library function to call
malloc?  If it is, then how about "...any library function
that would have been a syscall under Unix"?

Morten






   Here is a rewritten write() function, that in theory should optimize
   buffer use and transfer size when writing in text mode, and won't need
   to call malloc() at all.  Comments?

[...]

       /* we now have a transfer buf stuffed with data; write it out */
       r.x.ax = 0x4000;
       r.x.bx = handle;
       r.x.cx = bytes_in_tb;
       r.x.dx = __tb & 15;
       r.x.ds = __tb / 16;
       __dpmi_int(0x21, &r);

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019