File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66namespace 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!" );
Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments