GL CHOCO ENGINE
Loading...
Searching...
No Matches
choco_memory.h
Go to the documentation of this file.
1
26#ifndef GLCE_ENGINE_CORE_MEMORY_CHOCO_MEMORY_H
27#define GLCE_ENGINE_CORE_MEMORY_CHOCO_MEMORY_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <stddef.h>
34
35#ifdef TEST_BUILD
36#include <stdint.h>
37#endif
38
43typedef enum {
51
56typedef enum {
63
84
106void memory_system_destroy(void);
107
145memory_system_result_t memory_system_allocate(size_t size_, memory_tag_t mem_tag_, void** out_ptr_);
146
181void memory_system_free(void* ptr_, size_t size_, memory_tag_t mem_tag_);
182
202void memory_system_report(void);
203
204#ifdef TEST_BUILD
214void memory_system_test_param_set(int32_t malloc_fail_n_);
215
223void memory_system_rslt_code_set(memory_system_result_t result_code_);
224
229void memory_system_test_param_reset(void);
230#endif
231
232#ifdef __cplusplus
233}
234#endif
235#endif
memory_system_result_t memory_system_allocate(size_t size_, memory_tag_t mem_tag_, void **out_ptr_)
容量size_のメモリを確保し、mem_tag_で指定されたメモリタグのメモリ使用量を更新する
Definition: choco_memory.c:132
memory_system_result_t memory_system_create(void)
メモリシステムを起動する
Definition: choco_memory.c:73
memory_system_result_t
メモリシステム実行結果コードリスト
Definition: choco_memory.h:56
@ MEMORY_SYSTEM_LIMIT_EXCEEDED
Definition: choco_memory.h:60
@ MEMORY_SYSTEM_NO_MEMORY
Definition: choco_memory.h:61
@ MEMORY_SYSTEM_INVALID_ARGUMENT
Definition: choco_memory.h:58
@ MEMORY_SYSTEM_SUCCESS
Definition: choco_memory.h:57
@ MEMORY_SYSTEM_RUNTIME_ERROR
Definition: choco_memory.h:59
void memory_system_report(void)
メモリシステムが管理しているメモリ使用量状態を標準出力に出力する
Definition: choco_memory.c:206
memory_tag_t
メモリタグリスト
Definition: choco_memory.h:43
@ MEMORY_TAG_FILE_IO
Definition: choco_memory.h:48
@ MEMORY_TAG_RING_QUEUE
Definition: choco_memory.h:46
@ MEMORY_TAG_RENDERER
Definition: choco_memory.h:47
@ MEMORY_TAG_STRING
Definition: choco_memory.h:45
@ MEMORY_TAG_SYSTEM
Definition: choco_memory.h:44
@ MEMORY_TAG_MAX
Definition: choco_memory.h:49
void memory_system_free(void *ptr_, size_t size_, memory_tag_t mem_tag_)
ptr_が保持する領域のメモリを解放し、mem_tag_で指定されたメモリタグのメモリ使用量を更新する
Definition: choco_memory.c:177
void memory_system_destroy(void)
メモリシステムを停止する
Definition: choco_memory.c:114