GL CHOCO ENGINE
Loading...
Searching...
No Matches
renderer_memory.c File Reference

レンダラーレイヤーでのメモリ確保、メモリ解放処理のテストのため、memory_system内のallocate, free関数のラッパーAPIの実装 More...

Include dependency graph for renderer_memory.c:

Functions

renderer_result_t render_mem_allocate (size_t size_, void **out_ptr_)
 memory_system_allocateのラッパーAPI
 
void render_mem_free (void *ptr_, size_t size_)
 memory_system_freeのラッパーAPI
 

Detailed Description

レンダラーレイヤーでのメモリ確保、メモリ解放処理のテストのため、memory_system内のallocate, free関数のラッパーAPIの実装

Author
chocolate-pie24
Version
0.1
Date
2025-12.19
License
MIT License. See LICENSE file in the project root for full license text.

Function Documentation

◆ render_mem_allocate()

renderer_result_t render_mem_allocate ( size_t  size_,
void **  out_ptr_ 
)

memory_system_allocateのラッパーAPI

Note
レンダラーレイヤー専用APIのため、メモリータグはMEMORY_TAG_RENDERER固定
Parameters
size_メモリ確保サイズ(byte)
out_ptr_確保したメモリの格納先
Return values
RENDERER_INVALID_ARGUMENT以下のいずれか
  • メモリシステム未初期化
  • out_ptr_ == NULL
  • *out_ptr_ != NULL
RENDERER_LIMIT_EXCEEDEDメモリ管理システムのシステム使用可能範囲上限超過
RENDERER_NO_MEMORYメモリ割り当て失敗
RENDERER_UNDEFINED_ERROR想定していない実行結果コードを処理過程で受け取った
RENDERER_SUCCESS以下のいずれか
  • size_ == 0(*out_ptr_はNULLのまま)
  • 割り当てに成功し正常終了

◆ render_mem_free()

void render_mem_free ( void *  ptr_,
size_t  size_ 
)

memory_system_freeのラッパーAPI

Note
レンダラーレイヤー専用APIのため、メモリータグはMEMORY_TAG_RENDERER固定
引数にはvoid*型を渡しており、ptr_のメモリ開放後、NULLをセットすることはできない。 この仕様は、標準ライブラリのfree()の仕様に合わせた。なので、呼び出し側でメモリの解放後、NULLをセットすること。
Parameters
ptr_解放対象メモリアドレス
size_解放サイズ