internal
| 6752 | |
| 6753 | // internal |
| 6754 | void asCScriptEngine::DestroyList(asBYTE *buffer, const asCObjectType *listPatternType) |
| 6755 | { |
| 6756 | asASSERT( listPatternType && (listPatternType->flags & asOBJ_LIST_PATTERN) ); |
| 6757 | |
| 6758 | // Get the list pattern from the listFactory function |
| 6759 | // TODO: runtime optimize: Store the used list factory in the listPatternType itself |
| 6760 | // TODO: runtime optimize: Keep a flag to indicate if there is really a need to free anything |
| 6761 | asCObjectType *ot = CastToObjectType(listPatternType->templateSubTypes[0].GetTypeInfo()); |
| 6762 | asCScriptFunction *listFactory = scriptFunctions[ot->beh.listFactory]; |
| 6763 | asASSERT( listFactory ); |
| 6764 | |
| 6765 | asSListPatternNode *node = listFactory->listPattern; |
| 6766 | DestroySubList(buffer, node); |
| 6767 | |
| 6768 | asASSERT( node->type == asLPT_END ); |
| 6769 | } |
| 6770 | |
| 6771 | // internal |
| 6772 | void asCScriptEngine::DestroySubList(asBYTE *&buffer, asSListPatternNode *&node) |
no test coverage detected