From b623d277fa8afb1acebfbfdbd0e527e8b0d8e89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 21 Oct 2007 20:44:19 +0000 Subject: [PATCH] Moved Base.h into Slab.h, and removed Base.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22646 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/slab/Base.h | 56 ------------------------------ headers/private/kernel/slab/Slab.h | 49 +++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 57 deletions(-) delete mode 100644 headers/private/kernel/slab/Base.h diff --git a/headers/private/kernel/slab/Base.h b/headers/private/kernel/slab/Base.h deleted file mode 100644 index 69edca16e8..0000000000 --- a/headers/private/kernel/slab/Base.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2007, Hugo Santos. All Rights Reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Hugo Santos, hugosantos@gmail.com - */ -#ifndef _SLAB_BASE_SLAB_H_ -#define _SLAB_BASE_SLAB_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - /* create_object_cache_etc flags */ - CACHE_NO_DEPOT = 1 << 0, - CACHE_UNLOCKED_PAGES = 1 << 1, - - /* object_cache_alloc flags */ - CACHE_DONT_SLEEP = 1 << 8, - - /* internal */ - CACHE_DURING_BOOT = 1 << 31 -}; - -typedef struct object_cache object_cache; - -typedef status_t (*object_cache_constructor)(void *cookie, void *object); -typedef void (*object_cache_destructor)(void *cookie, void *object); -typedef void (*object_cache_reclaimer)(void *cookie, int32 level); - -object_cache *create_object_cache(const char *name, size_t object_size, - size_t alignment, void *cookie, object_cache_constructor constructor, - object_cache_destructor); -object_cache *create_object_cache_etc(const char *name, size_t object_size, - size_t alignment, size_t max_byte_usage, uint32 flags, void *cookie, - object_cache_constructor constructor, object_cache_destructor destructor, - object_cache_reclaimer reclaimer); - -void delete_object_cache(object_cache *cache); - -void *object_cache_alloc(object_cache *cache, uint32 flags); -void object_cache_free(object_cache *cache, void *object); - -status_t object_cache_reserve(object_cache *cache, size_t object_count, - uint32 flags); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/headers/private/kernel/slab/Slab.h b/headers/private/kernel/slab/Slab.h index 92a1c870e3..e7d313b4a0 100644 --- a/headers/private/kernel/slab/Slab.h +++ b/headers/private/kernel/slab/Slab.h @@ -8,7 +8,54 @@ #ifndef _SLAB_SLAB_H_ #define _SLAB_SLAB_H_ -#include + #include +#include +#include + + +enum { + /* create_object_cache_etc flags */ + CACHE_NO_DEPOT = 1 << 0, + CACHE_UNLOCKED_PAGES = 1 << 1, + + /* object_cache_alloc flags */ + CACHE_DONT_SLEEP = 1 << 8, + + /* internal */ + CACHE_DURING_BOOT = 1 << 31 +}; + +typedef struct object_cache object_cache; + +typedef status_t (*object_cache_constructor)(void *cookie, void *object); +typedef void (*object_cache_destructor)(void *cookie, void *object); +typedef void (*object_cache_reclaimer)(void *cookie, int32 level); + + +#ifdef __cplusplus +extern "C" { #endif + +object_cache *create_object_cache(const char *name, size_t object_size, + size_t alignment, void *cookie, object_cache_constructor constructor, + object_cache_destructor); +object_cache *create_object_cache_etc(const char *name, size_t object_size, + size_t alignment, size_t max_byte_usage, uint32 flags, void *cookie, + object_cache_constructor constructor, object_cache_destructor destructor, + object_cache_reclaimer reclaimer); + +void delete_object_cache(object_cache *cache); + +void *object_cache_alloc(object_cache *cache, uint32 flags); +void object_cache_free(object_cache *cache, void *object); + +status_t object_cache_reserve(object_cache *cache, size_t object_count, + uint32 flags); + +#ifdef __cplusplus +} +#endif + +#endif /* _SLAB_SLAB_H_ */