Subject: duplicated code in machdep.c
To: None <tech-kern@NetBSD.ORG>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-kern
Date: 11/14/1997 23:01:58
I notice that in every port, code to allocate a "random" set of memory
chunks is duplicated in `machdep.c:allocsys()'. That routine
allocates the callout queue, several SYSV shared memory/semaphore
structures and the buffer pools.

Is there a good reason I should not try to collect those things
into a common file?

Except for the buffer cache allocation -- which varies a bit among ports --
all the other seem very straightforward candidates for moving into
initialization functions located within their respective "implementation"
modules. Those initialization routines would just call malloc() to
get the memory.

Ok, so this might waste a small amount of memory -- because of
fragmentation in the malloc pools -- compared to the machdep's
`valloc()' method, but I don't think that's really worth much concern.

Any ports with special needs here?

-pk