home bbs files messages ]

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

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

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

   Message 262,723 of 264,096   
   Lawrence D'Oliveiro to All   
   Re: FreeTDS port to VMS V9.x on x86?   
   27 Jun 25 00:03:04   
   
   From: ldo@nz.invalid   
      
   On Tue, 24 Jun 2025 12:25:50 -0400, Arne Vajhøj wrote:   
      
   > The algorithm is basically to try vsnprintf with buffers increasing in   
   > size 512, 1024, 1536, ... until there is space.   
   >   
   > That is very inefficient compared to just use the return value.   
      
   It’s a good choice in the absence of any other clues as to how much to   
   allocate. I have used it myself. (Of course having an explicit number   
   returned is best of all.)   
      
   One may conduct statistical analyses, I suppose to decide on the optimum   
   multiplication factor. E.g. would going up in powers of 3 better than   
   powers of 2? I suspect larger factors (too far from e = 2.71828 ...) would   
   not be worth using.   
      
   And don’t forget to do a realloc(3) at the end, to trim the unused part of   
   the last allocation.   
      
   --- 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