bug in sps memory size reporting for Sun-3
    Chris Torek 
    chris at mimsy.UUCP
       
    Wed Jun  1 07:42:46 AEST 1988
    
    
  
In article <5654 at columbia.edu> dupuy at douglass.columbia.edu
(Alexander Dupuy) writes:
>... The header file sps.h assumed that all Suns would have a page size of 2K.
[some diffs deleted; then:]
>  /* Convert clicks to kbytes ... */
>! # ifndef PGSHIFT
>  # define        KBYTES( size )  ((size) << 1)
>  # else
>+ # if PGSHIFT > 10
>+ # define        KBYTES( size )  ((size) << (PGSHIFT - 10))
>+ # else
>  # define        KBYTES( size )  ((size) >> (10 - PGSHIFT))
>+ # endif
Why not simply use the macro that is provided for this purpose?
	#include <sys/param.h>
	#define KBYTES(size) (ctob(size) >> 10) /* or ctob(size) / 1024 */
(PCC tends not to merge the shifts, but that probably will make little
real difference.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris
    
    
More information about the Comp.sources.bugs
mailing list