2009-08-28 18:39:55 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _REALTIME_ALLOC_H
|
2002-07-09 16:24:59 +04:00
|
|
|
#define _REALTIME_ALLOC_H
|
|
|
|
|
2009-08-28 18:39:55 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2009-08-28 18:39:55 +04:00
|
|
|
|
2009-12-01 20:21:46 +03:00
|
|
|
#ifdef __cplusplus
|
2002-07-09 16:24:59 +04:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct rtm_pool rtm_pool;
|
|
|
|
|
2009-12-01 20:21:46 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize,
|
2009-08-28 18:39:55 +04:00
|
|
|
const char* name = NULL);
|
2002-07-09 16:24:59 +04:00
|
|
|
#else
|
2009-12-01 20:21:46 +03:00
|
|
|
status_t rtm_create_pool(rtm_pool** _pool, size_t totalSize, const char* name);
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif
|
2009-08-28 18:39:55 +04:00
|
|
|
|
|
|
|
status_t rtm_delete_pool(rtm_pool* pool);
|
|
|
|
|
|
|
|
void* rtm_alloc(rtm_pool* pool, size_t size);
|
|
|
|
status_t rtm_free(void* data);
|
|
|
|
status_t rtm_realloc(void** data, size_t new_size);
|
|
|
|
status_t rtm_size_for(void* data);
|
|
|
|
status_t rtm_phys_size_for(void* data);
|
2009-12-01 20:21:46 +03:00
|
|
|
size_t rtm_available(rtm_pool* pool);
|
2009-08-28 18:39:55 +04:00
|
|
|
|
|
|
|
rtm_pool* rtm_default_pool();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-12-01 20:21:46 +03:00
|
|
|
#ifdef __cplusplus
|
2002-07-09 16:24:59 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _REALTIME_ALLOC_H
|