xref: /haiku/src/system/kernel/slab/SmallObjectCache.h (revision 2069f565e8ed3556b30cf2f5e3aa54450128b8c2)
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 									uint32 flags, void* cookie,
18 									object_cache_constructor constructor,
19 									object_cache_destructor destructor,
20 									object_cache_reclaimer reclaimer);
21 	virtual	void				Delete();
22 
23 	virtual	slab*				CreateSlab(uint32 flags);
24 	virtual	void				ReturnSlab(slab* slab, uint32 flags);
25 	virtual slab*				ObjectSlab(void* object) const;
26 };
27 
28 
29 #endif	// SMALL_OBJECT_CACHE_H
30