xref: /haiku/src/system/kernel/slab/SmallObjectCache.h (revision e81a954787e50e56a7f06f72705b7859b6ab06d1)
1 /*
2  * Copyright 2008, Axel Dörfler. All Rights Reserved.
3  * Copyright 2007, Hugo Santos. All Rights Reserved.
4  *
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef SMALL_OBJECT_CACHE_H
8 #define SMALL_OBJECT_CACHE_H
9 
10 
11 #include "ObjectCache.h"
12 
13 
14 struct SmallObjectCache : ObjectCache {
15 	static	SmallObjectCache*	Create(const char* name, size_t object_size,
16 									size_t alignment, size_t maximum,
17 									size_t magazineCapacity,
18 									size_t maxMagazineCount,
19 									uint32 flags, void* cookie,
20 									object_cache_constructor constructor,
21 									object_cache_destructor destructor,
22 									object_cache_reclaimer reclaimer);
23 	virtual	void				Delete();
24 
25 	virtual	slab*				CreateSlab(uint32 flags);
26 	virtual	void				ReturnSlab(slab* slab, uint32 flags);
27 	virtual slab*				ObjectSlab(void* object) const;
28 };
29 
30 
31 #endif	// SMALL_OBJECT_CACHE_H
32