Skip to content

Commit 71657a1

Browse files
committed
review
1 parent dcccd47 commit 71657a1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

source/ScmFunction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
namespace CLEO
77
{
88
ScmFunction* ScmFunction::store[Store_Size] = {0};
9-
const size_t Default_Index = 1;
10-
size_t ScmFunction::allocationPlace = Default_Index;
9+
size_t ScmFunction::allocationPlace = ScmFunction::Default_Index;
1110

1211
ScmFunction* ScmFunction::Get(unsigned short idx)
1312
{
@@ -22,15 +21,15 @@ namespace CLEO
2221
{
2322
if (scmFunc != nullptr) delete scmFunc;
2423
}
25-
ScmFunction::allocationPlace = Default_Index;
24+
ScmFunction::allocationPlace = ScmFunction::Default_Index;
2625
}
2726

2827
void* ScmFunction::operator new(size_t size)
2928
{
3029
size_t start_search = allocationPlace;
3130
while (store[allocationPlace] != nullptr) // find first unused position in store
3231
{
33-
if (++allocationPlace >= Store_Size) allocationPlace = Default_Index; // end of store reached
32+
if (++allocationPlace >= Store_Size) allocationPlace = ScmFunction::Default_Index; // end of store reached
3433
if (allocationPlace == start_search)
3534
{
3635
SHOW_ERROR("CLEO function storage stack overflow!");

source/ScmFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ namespace CLEO
66
{
77
struct ScmFunction
88
{
9-
static const size_t Store_Size = 0x400;
9+
static constexpr size_t Store_Size = 0x400;
10+
static constexpr size_t Default_Index = 1;
1011
static ScmFunction* store[Store_Size];
1112
static size_t allocationPlace; // contains an index of last allocated object
1213
static ScmFunction* Get(unsigned short idx);

0 commit comments

Comments
 (0)