[cap-talk] Another "core" principle - virtualizing memory
Jonathan Adams
jwadams at gmail.com
Thu Jan 4 11:23:59 CST 2007
On 1/4/07, Jonathan S. Shapiro <shap at eros-os.com> wrote:
>
> On Wed, 2007-01-03 at 23:01 +0000, David Hopwood wrote:
> > Nitpick: memory pools in general need not be used only for a single
> > type, and may not be implemented as an array/vector. Their advantages
> > come from separating allocations that should be independent of each
> other,
> > regardless of type or how the pool is implemented. It can also be a
> > simplification to have different threads allocating from different
> pools.
>
> Yes. In fact, early versions of BSD kmalloc were often partitioned by
> the size of the allocated unit rather than the type. The introduction of
> named pools (all elements of a pool required to be of same size) came
> later.
In Solaris, kmem_alloc() partitions by size (a pre-determined set of cache
sizes), and kmem_cache_alloc() allows things more like "named" pools (with
some handy additional features, like constructors and destructors), where
all object have the same type and size. Most highly-used structures come
out of such caches.
Cheers,
- jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eros-os.org/pipermail/cap-talk/attachments/20070104/00609925/attachment.html
More information about the cap-talk
mailing list