Hi! Just to ask ...
> Or perhaps even remove the use of PAGE_SIZE altogether and just use 4k > everywhere. I think this code seriously raises a question as to whether it's > using PAGE_SIZE to mean "the system page size" or whether it's using > PAGE_SIZE to mean "4096 but we don't want to write a magic > number in the source so we picked a macro whose value happened to be 4096" > and I suspect it's the latter.... > ... why not using an own constant for this? Like ... #if defined PAGE_SIZE #define PAGE_BUFFER_SIZE PAGE_SIZE #elif defined PAGESIZE #define PAGE_BUFFER_SIZE PAGESIZE #else #define PAGE_BUFFER_SIZE 4096 #endif ... and use PAGE_BUFFER_SIZE everywhere a buffer of corresponding size is required. ... or may be name it just BUFFER_SIZE or BIG_BUFFER_SIZE --> #define SMALL_BUFFER_SIZE (BIG_BUFFER_SIZE / 4) => 1024 (or 2048) #define TINY_BUFFER_SIZE (SMALL_BUFFER_SIZE / 4) => 256 (or 512) #define HUGE_BUFFER_SIZE (BIG_BUFFER_SIZE * 4) => 16384 (or 32768) That's the way I do it in code of mine (just as a suggestion). -- Harald _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
