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 978 of 2,978   
   Marco van de Voort to Glenn Someone   
   Re: FPC Questions   
   26 Sep 04 23:57:46   
   
   From: marcov@stack.nl   
      
   On 2004-09-24, Glenn Someone    
   wrote:   
   > Maxavail works in the context of the currently allocated heap through   
   > DPMI.  Not acceptable.   
      
   > What is suggested below would turn the program into a "memory hog" as   
   > L D Blake mentions.  Again not acceptable.   
      
   That's what your code does, I can't make more of that.   
      
   To summarize your problem:   
      
   - you don't want to make a fixed heapmgr limit (because of sys requirements   
    would change)   
   - you don't want to change the main body of the code.   
   - FPC doesn't allow to do set the heaplimit dynamically (say like use 2/3 of   
     avail mem), since such information provided   
     by DPMI is not reliable (it might be swap leading to trashing)   
      
   Only solution then to get pretty much any desired behaviour is to copy the   
   existing FPC memory manager, and modify/wrap it.   
      
   This allows among others:   
   - allocate heap up to a certain limit. This limit can be determined runtime   
   	(DPMI calls/ specified on cmdline)   
   - give a value for memavail/maxavail relative to this limit.   
   - this heapmgr goes in a separate unit, which has to be first or last in   
   	the mainprogram USES list. This can be under ifdef, and be pretty   
   	much the only FPC specific workaround for this particular problem.   
      
   However this requires some programming (not much, understanding the heapmgr   
   workings is the relatively hard part. See fpc/rtl/inc/heap.inc in the fpc   
   help tree, and unit cmem as example of how to make a custom memmgr). Probably   
   there are parts about heapmgr plugging in the FPC manuals too.   
      
   Note: you don't necessarily need a full heapmgr replacement, just a wrapper   
   probably.   
      
   --- 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