#ifndef MRT_CKI_H
#define MRT_CKI_H
#include <cstdint>
#include "Base/Log.h"
#include "schedule.h"
namespace MapleRuntime {
namespace Cki {
const uint8_t SLOT_TABLE_SIZE = 8;
extern CJThreadKey cjthreadKeyItems[SLOT_TABLE_SIZE];
enum CJThreadKeySlot {
SLOT_MUTATOR = 0,
CKI_SIZE = 1,
RESERVED_2 = 2,
RESERVED_3 = 3,
RESERVED_4 = 4,
RESERVED_5 = 5,
RESERVED_6 = 6,
RESERVED_7 = 7
};
int CreateCKI();
inline int SetCKI(const void* value, CJThreadKeySlot slot)
{
return CJThreadSetspecific(cjthreadKeyItems[slot], const_cast<void*>(value));
}
inline void* GetCKI(CJThreadKeySlot slot) { return CJThreadGetspecific(cjthreadKeyItems[slot]); }
}
}
#endif