Board.KolibriOS.org

Official KolibriOS board
It is currently Sun Jan 17, 2021 12:54 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Slab allocator
PostPosted: Wed Jun 03, 2020 8:10 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 599
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.


Attachments:
slab.diff [9.68 KiB]
Downloaded 47 times
Top
   
 Post subject: Re: Slab allocator
PostPosted: Wed Jun 03, 2020 1:04 pm 
Offline
User avatar

Joined: Mon Apr 06, 2020 1:09 pm
Posts: 69
I think code reuse is good practice.

_________________
The best way to predict the future is to create it.


Top
   
 Post subject: Re: Slab allocator
PostPosted: Thu Jun 11, 2020 4:29 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 599
Committed in r8037.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited