home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / msdos / programm / 11584 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.2 KB  |  55 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!ulowell!woods.ulowell.edu!mcardleb
  3. From: mcardleb@woods.ulowell.edu
  4. Subject: * BorlandC++ overlay (or how to get blood from a stone)
  5. Message-ID: <1992Dec22.193612.1@woods.ulowell.edu>
  6. Lines: 44
  7. Sender: usenet@ulowell.ulowell.edu (News manager - ulowell)
  8. Organization: University of Lowell
  9. Date: Wed, 23 Dec 1992 00:36:12 GMT
  10.  
  11. Hi all,
  12.  
  13.     Got a problem with the new Borland C/C++ 3.1 protected mode compiler.
  14.  
  15. I got this compiler because I thought it would compile a protected mode program
  16. (Borland  does say it "breaks the 640K barrier" but all they mean is the 
  17. compiler runs in protected mode.  I sure wish they would mean what they say!
  18.  
  19. Anyway,  I am trying to use the overlay manager in the IDE.  I am trying to 
  20. access multiple data arrays that each could be larger than 64K bytes.  I am
  21. just writing a demo program now to test if the overlay system will help.
  22. I have three modules(each one has one function) .  Each function has the line:
  23.  
  24.     static unsigned char huge arrayx[250000];
  25.  
  26. I do some setting of the arrays and then return to the previous module.
  27.  
  28. The module with main() initializes the overlay manager with
  29.     
  30.     _ovrbuffer = 0x8000;
  31.     _OvrInitExt(0,0);
  32.  
  33. This gives me all the extended memory for the overlay swapper with 0x80000 of
  34. overlay buffer (524288 bytes if I calculated this correctly - the Borland 
  35. manuals don't say how this number is calculated but I can guess it is the 
  36. number of paragraphs).
  37.  
  38. The compiler is compiling in DOS overlay with the HUGE memory model.
  39.  
  40. Now it will compile,  executable is over 750,000 bytes  but when I run it from
  41. the IDE it says not enough memory.  I have 2M in the IDE and another 2M not 
  42. used. When I run it from DOS it says cannot execute prog.c.  I guess this is
  43. because DOS won't allow 750,000 to fit in < 640K.  
  44.  
  45. Anybody have a clue to what goes on.  I wouldn't like to think Borland is 
  46. false advertising with their compiler. I would loose a lot of respect for
  47. PC's in general if vendors sell full blown pc's with tons of memory that
  48. only the pros can use.
  49.  
  50.     Thanks for any replies or comments.
  51.         Bruce
  52. -- 
  53. Bruce McArdle                  /   So THIS is what being a GRAD student
  54. mcardleb@woods.ulowell.edu    /   is all about... oUUUUUUUU . . .
  55.