home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,210 of 2,978   
   Jason Burgon to Jud McCranie   
   Re: Error 49: Data segment too large....   
   29 Dec 04 11:57:00   
   
   From: gvision@ntlworld.com   
      
   "Jud McCranie"  wrote in message   
   news:m571t0t1smhh0o353715h7b8n7h3pmlta0@4ax.com...   
   > On 27 Dec 2004 14:34:10 -0800, "paulsm"  wrote:   
   >   
   > >1. Is there any way to create and use a second data segment in   
   > >Borland Pascal?   
   >   
   > Yes, sort of. I did it often by having one big procedure and all the   
   > main program did was call that procedure.   
      
   That will not acheive anything as far a providing more space for data is   
   concerned.   
      
   > The main program can have almost 64KB of data and the procedure can >have   
   almost 64KB of data.   
      
   Wrong. The data segment of a BP program is shared by all its units and   
   (therefore) procedures. It is also where the virtual method tables of each   
   unique object type (not instance) is stored, so programs with lots of   
   different and/or large object types can have a severely restricted data   
   segment available to them.   
      
   The best way is to use the heap to provide the application with more data   
   memory, using dynamically allocated structures. If actual data segment   
   memory is required, then try:   
      
   (1) Using dynamic memory for large or numerous data structures (as above).   
      
   (2) Reducing the number of object types used and/or replacing virtual   
   methods with dynamic ones.   
      
   --   
   Jay   
      
   Author of Graphic Vision   
   http://homepage.ntlworld.com/gvision/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca