delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/03/04/02:47:41

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
NNTP-Posting-Date: Tue, 04 Mar 2008 01:36:04 -0600
Date: Mon, 03 Mar 2008 23:36:04 -0800
From: Jim Michaels <jmichae3REMOVE AT THISPLEASEyahoo DOT com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: DOS memory allocation
Message-ID: <68WdndzvYfJ5ZlHanZ2dnUVZ_jqdnZ2d@comcast.com>
Lines: 24
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 24.20.110.103
X-Trace: sv3-Bfw3Afy/DSVBPW3JDDSrzHU+R6ycXeGovzbuqvDahi4DmgZeDlffJugtVgSFw4gckcQMuMfW5gyrgfj!NxHtFD7plLTMA0NfWQHAY4wIx+X/Vf3da+i1pDk4AIzqenxHur4oOhRtK1Us8KxLBgJbRMXGwQOh!41axQ1Pk37JUqBgyg1iZJuMuy+lwgQ==
X-Complaints-To: abuse AT comcast DOT net
X-DMCA-Complaints-To: dmca AT comcast DOT net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.37
X-Original-Bytes: 1941
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

         void dldpalloc_dos_buffer(DWORD size) {
             if (dos_segment_buf) {
                 return;
             }
             int z=sizeof(size)/16+(sizeof(size)%16>0)?1:0;
             dos_segment_buf=__dpmi_allocate_dos_memory(z, 
&dos_selector_buf);
             if (dos_segment_buf == -1) {
                 dos_segment_buf=0;
                 return;
             }
             tb_buf=__tb;
 
dap.addressOfTransferBufferInSegOfs.segOfs.segmentPart=tb_buf>>4;
 
dap.addressOfTransferBufferInSegOfs.segOfs.offsetPart=tb_buf&0xf;
         }


does this work for multiple allocs?  or am I deluding myself?
what I am asking about here is the __tb part.  actually, the whole thing.
-- 
  Jim Michaels
  for email, edit the address

- Raw text -


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