home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v3 / text0018.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  1.5 KB

  1. Date: Thu, 14 Nov 85 17:21:36 pst
  2. From: saber!msc@ihnp4.uucp (Mark Callow)
  3.  
  4. > From: Kee Hinckley <harvard!wanginst!apollo!nazgul>
  5. > In article <3430@ut-sally.UUCP> you write:
  6. > > Date: 06 Oct 85 18:36:07 +1000 (Sun)
  7. > > >From: Robert Elz <munnari!kre@seismo.CSS.GOV>
  8. > ...
  9. > > I suggest deleting all of the constants, and instead specifying
  10. > > a library routine, which when handed a name defined in <limits.h>
  11. > > will return the associated constant.
  12. > > 
  13. > One problem with this is that a piece of code may want to #if off of
  14. > particular constants.  For instance, if I discover that the amount
  15. > of memory I have is too small, and I don't have virtual memory then
  16. > I might want to use temporary files.
  17. You can do this just as well with an if statement at runtime.  Then
  18. if someone decides to add more memory to their machine they don't
  19. have to recompile their world to take advantage of it.
  20.  
  21. > ...but it would not work out nearly as well if I had to
  22. > make that kind of decision at runtime.
  23. Why not?  The penalty is a small increase in the size of the
  24. binary.
  25.  
  26. limits.h and all similar kinds of wired-in constants are the pits.
  27. What happens in a network environment?  Do your servers have one
  28. copy of the program for each client configuration?  Of course not.
  29. What does a computer manufacturer do?  Have a different software
  30. release for each system configuration?  Of course not.  You
  31. either end up in the least common denominator trap or you ignore
  32. limits.h and implement the library function suggested by kre.
  33.  
  34. Volume-Number: Volume 3, Number 19
  35.  
  36.