1 /* 2 * Copyright 2009, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _REALTIME_ALLOC_H 6 #define _REALTIME_ALLOC_H 7 8 9 #include <SupportDefs.h> 10 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 typedef struct rtm_pool rtm_pool; 17 18 #ifdef __cplusplus 19 status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize, 20 const char* name = NULL); 21 #else 22 status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize, const char* name); 23 #endif 24 25 status_t rtm_delete_pool(rtm_pool* pool); 26 27 void* rtm_alloc(rtm_pool* pool, size_t size); 28 status_t rtm_free(void* data); 29 status_t rtm_realloc(void** data, size_t new_size); 30 status_t rtm_size_for(void* data); 31 status_t rtm_phys_size_for(void* data); 32 size_t rtm_available(rtm_pool* pool); 33 34 rtm_pool* rtm_default_pool(); 35 36 #ifdef __cplusplus 37 } 38 #endif 39 40 #endif // _REALTIME_ALLOC_H 41