xref: /haiku/headers/os/media/RealtimeAlloc.h (revision ccedee2295acd8a7b318ee2bfc34307f17e603c7)
1cb3f273dSStephan Aßmus /*
2cb3f273dSStephan Aßmus  * Copyright 2009, Haiku, Inc. All rights reserved.
3cb3f273dSStephan Aßmus  * Distributed under the terms of the MIT License.
4cb3f273dSStephan Aßmus  */
5cb3f273dSStephan Aßmus #ifndef _REALTIME_ALLOC_H
652a38012Sejakowatz #define _REALTIME_ALLOC_H
752a38012Sejakowatz 
8cb3f273dSStephan Aßmus 
952a38012Sejakowatz #include <SupportDefs.h>
1052a38012Sejakowatz 
11cb3f273dSStephan Aßmus 
12*ccedee22SAxel Dörfler #ifdef __cplusplus
1352a38012Sejakowatz extern "C" {
1452a38012Sejakowatz #endif
1552a38012Sejakowatz 
1652a38012Sejakowatz typedef struct rtm_pool rtm_pool;
1752a38012Sejakowatz 
18*ccedee22SAxel Dörfler #ifdef __cplusplus
19*ccedee22SAxel Dörfler status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize,
20cb3f273dSStephan Aßmus 	const char* name = NULL);
2152a38012Sejakowatz #else
22*ccedee22SAxel Dörfler status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize, const char* name);
2352a38012Sejakowatz #endif
24cb3f273dSStephan Aßmus 
25f6e4cbb9SAxel Dörfler status_t rtm_delete_pool(rtm_pool* pool);
26cb3f273dSStephan Aßmus 
27f6e4cbb9SAxel Dörfler void* rtm_alloc(rtm_pool* pool, size_t size);
28f6e4cbb9SAxel Dörfler status_t rtm_free(void* data);
29f6e4cbb9SAxel Dörfler status_t rtm_realloc(void** data, size_t new_size);
30f6e4cbb9SAxel Dörfler status_t rtm_size_for(void* data);
31f6e4cbb9SAxel Dörfler status_t rtm_phys_size_for(void* data);
32*ccedee22SAxel Dörfler size_t rtm_available(rtm_pool* pool);
3352a38012Sejakowatz 
34f6e4cbb9SAxel Dörfler rtm_pool* rtm_default_pool();
3552a38012Sejakowatz 
36*ccedee22SAxel Dörfler #ifdef __cplusplus
3752a38012Sejakowatz }
3852a38012Sejakowatz #endif
3952a38012Sejakowatz 
4052a38012Sejakowatz #endif // _REALTIME_ALLOC_H
41