Subject: Re: revised two-level bitmap fdalloc diff
To: None <provos@citi.umich.edu>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-perform
Date: 10/29/2003 21:08:42
> + /*
> + * These arrays are used when the number of open files is
> + * <= 1024, and are then pointed to by the pointers above.
> + */
> + uint32_t fd_dhimap[NDENTRIES >> NDENTRYSHIFT];
> + uint32_t fd_dlomap[NDENTRIES];
if it's your intent,
fdexpand() shouldn't do malloc() unless nfiles > 1024 and
tests in fdcopy() and fdfree() are wrong.
also, rather than abusing NDENTRIES here,
i think code like followings are more clear.
#define NDFILE_BITMAP 1024
uint32_t fd_dhimap[NDHISLOTS(NDFILE_BITMAP)];
uint32_t fd_dlomap[NDLOSLOTS(NDFILE_BITMAP)];
YAMAMOTO Takashi