Page 1 of 1

Slab allocator

Posted: Wed Jun 03, 2020 8:10 am
by dunkaist
Hello,

If I understand correctly, kernel/trunk/bus/usb/memory.inc has implementation of a slab allocator. Namely, usb_allocate_common and usb_free_common.

I need such an allocator for many (~10k) small (~64B) fixed-size ACPI namespace objects, and therefore I want to
  1. move its code to, say, kernel/trunk/core/slab.inc,
  2. rename usb_allocate_common / usb_free_common to slab_alloc / slab_free.
Any objections or things to do?
Patch for curious is attached.

Re: Slab allocator

Posted: Wed Jun 03, 2020 1:04 pm
by rgimad
I think code reuse is good practice.

Re: Slab allocator

Posted: Thu Jun 11, 2020 4:29 pm
by dunkaist
Committed in r8037.