/** * @file kc_memory_mark.h * @brief KC メモリ管理 メモリ状態を扱うサブモジュール (mark) * @copyright 2003 - 2023 Nomura Kei * @depends * kc.h * * 本ヘッダファイルを直接 include せず、kc_memory.h を include してください。 */ #ifndef KC_MEMORY_MARK_H #define KC_MEMORY_MARK_H #include <kc.h> #ifdef __cplusplus extern "C" { namespace kc { using namespace std; #endif /** * メモリ状態 */ typedef enum { KC_MEMORY_DELETED = 0x55AA0000, //!< 解放済み KC_MEMORY_ALLOCATED = 0x55AA1111, //!< 確保済み KC_MEMORY_ALLOCATED_NEW = 0x55AA2222, //!< new により確保済み KC_MEMORY_ALLOCATED_NEW_ARRAY = 0x55AA4444 //!< new[] により確保済み } KcMemoryMark; /** * 指定されたメモリ状態に対応する文字列表現を返します。 * 返される文字列は、次の通り * - alloc : malloc, calloc, realloc によりメモリが確保された * - new : new によりメモリが確保された * - new[] : new[] によりメモリが確保された * - delete : 削除済みメモリ * - other : 不明 * * @param mark メモリ状態 * @return メモリ状態に対応する文字列表現 */ const char *KcMemoryMark_to_string(int mark); #ifdef __cplusplus } // namespace kc } // extern "C" #endif #endif // KC_MEMORY_MARK_H