|
Revision 138, 2.6 kB
(checked in by hak, 6 months ago)
|
- Added CCilVm::reset()
- Fixed VM status management (ticket #5)
- Fixed API names not to have upper case as 1st letter.
- Fixed sample build break
- Added new sample, "vm_contol" to demonstrate VM status control API
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
#include "stdafx.h" |
|---|
| 24 |
#include "criScript.h" |
|---|
| 25 |
#include "cilVM.h" |
|---|
| 26 |
namespace cri { |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
void CCilVm::cleanObjectPool() |
|---|
| 35 |
{ |
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
int32_t iDeletedObject = 0; |
|---|
| 40 |
size_t iSize = getObjectPool().size(); |
|---|
| 41 |
list< CVmObject >::iterator itSt = getObjectPool().begin(); |
|---|
| 42 |
list< CVmObject >::iterator itEnd = getObjectPool().end(); |
|---|
| 43 |
while( itSt != itEnd ) |
|---|
| 44 |
{ |
|---|
| 45 |
{ |
|---|
| 46 |
iDeletedObject++; |
|---|
| 47 |
|
|---|
| 48 |
hash_map< wstring, CVariable >::iterator itStart = itSt->getPropertyMap().begin(); |
|---|
| 49 |
hash_map< wstring, CVariable >::iterator itEnd = itSt->getPropertyMap().end(); |
|---|
| 50 |
while( itStart != itEnd ) |
|---|
| 51 |
{ |
|---|
| 52 |
itStart->second.iOperandType = OPERAND_SYSTEM_DELETION; |
|---|
| 53 |
itStart ++; |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
itSt->getPropertyMap().clear(); |
|---|
| 58 |
|
|---|
| 59 |
itSt->getParentVariable().iOperandType = OPERAND_SYSTEM_DELETION; |
|---|
| 60 |
itSt->getValue().iOperandType = OPERAND_SYSTEM_DELETION; |
|---|
| 61 |
|
|---|
| 62 |
} |
|---|
| 63 |
itSt++; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
void CCilVm::clearRefCount() |
|---|
| 74 |
{ |
|---|
| 75 |
list< CVmObject >::iterator itSt = getObjectPool().begin(); |
|---|
| 76 |
list< CVmObject >::iterator itEnd = getObjectPool().end(); |
|---|
| 77 |
while( itSt != itEnd ) |
|---|
| 78 |
{ |
|---|
| 79 |
itSt->clearRefCount(); |
|---|
| 80 |
itSt ++; |
|---|
| 81 |
} |
|---|
| 82 |
} |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
} |
|---|