public static DescriptorInfo DescriptorInfo(HeapCell aCell, HeapStatistics aStats) { DescriptorInfo ret = null; // if (iAlgorithms.Count == 0) { PrepareAlgorithms(aStats); } // foreach (DescriptorAlgorithmBase alg in iAlgorithms) { bool isDes = alg.IsDescriptor(aCell, out ret); if (isDes && ret != null) { // We won't allow any algorithm to "recognise" the heap cell as a descriptor // unless it can say that the length is > 0. int length = ret.Length; if (length > 0) { break; } else { ret = null; } } } return(ret); }
internal virtual bool IsDescriptor(HeapCell aCell, out DescriptorInfo aInfo) { aInfo = null; iCell = aCell; // bool couldBeDescriptor = (aCell.Symbol == null && RawItems.Count > 1); if (couldBeDescriptor) { int payloadLength = PayloadLengthWhenCellIsDescriptor; int possibleDescriptorLength = CalculatedDescriptorLength; // couldBeDescriptor = (possibleDescriptorLength <= payloadLength); // if (couldBeDescriptor) { // Need to make a descriptor info object just to get the type... DescriptorInfo info = new DescriptorInfo(aCell); couldBeDescriptor = (info.Type != HeapCell.TDescriptorType.EUnknown); } } // return(couldBeDescriptor); }