internal ScriptAnalyzeDataManager_Internal(int length, Allocator allocator) { FileLength = length; long size = sizeof(TextFile) * FileLength; Files = (TextFile *)UnsafeUtility.Malloc(size, 4, allocator); UnsafeUtility.MemClear(Files, size); RaceParserTempData = new RaceParserTempData(16, allocator); MovetypeParserTempData = new MovetypeParserTempData(16, allocator); VoiceParserTempData = new VoiceParserTempData(128, 256, allocator); ASTValueTypePairList = new ASTTypePageIndexPairListLinkedList(1024, allocator); }
public DeleteCommentJob(TextFile *filePtr, bool isDebug) { this.Contents = filePtr->Contents; this.LineStarts = filePtr->LineStarts; this.LineLengths = filePtr->LineLengths; if (isDebug) { this.isDebug = 1; } else { this.isDebug = 0; } this.LineCountPtr = &filePtr->LineCount; }
public void Dispose(Allocator allocator) { if (FileLength != 0) { for (int i = 0; i < FileLength; i++) { if (Files + i != null) { Files[i].Dispose(allocator); } } if (Files != null) { UnsafeUtility.Free(Files, allocator); Files = null; } } RaceParserTempData.Dispose(allocator); MovetypeParserTempData.Dispose(allocator); VoiceParserTempData.Dispose(allocator); ASTValueTypePairList.Dispose(allocator); this = default; }
public static JobHandle Schedule(TextFile *filePtr, bool isDebug) => new DeleteCommentJob(filePtr, isDebug).Schedule();