void findPtr(P_ p, int follow) { uint32_t g, n; bdescr *bd; const int arr_size = 1024; StgPtr arr[arr_size]; int i = 0; searched = 0; for (n = 0; n < n_capabilities; n++) { bd = nurseries[i].blocks; i = findPtrBlocks(p,bd,arr,arr_size,i); if (i >= arr_size) return; } for (g = 0; g < RtsFlags.GcFlags.generations; g++) { bd = generations[g].blocks; i = findPtrBlocks(p,bd,arr,arr_size,i); bd = generations[g].large_objects; i = findPtrBlocks(p,bd,arr,arr_size,i); if (i >= arr_size) return; } if (follow && i == 1) { debugBelch("-->\n"); findPtr(arr[0], 1); } }
shared_ptr<Shape> Space::pointQueryFirst(Vect p, Layers layers, Group group) const { cpShapeFilter filter{static_cast<cpGroup>(group), static_cast<cpBitmask>(layers), static_cast<cpBitmask>(layers)}; cpPointQueryInfo i; return findPtr(cpSpacePointQueryNearest(space, p, 100, filter, &i)); }
BOOL CPathDescArray::removePtr(CPathDescriptor *pD) { int n = findPtr(pD); if(n == -1) return FALSE; RemoveAt(n, 0); return TRUE; }
int NeuralInterface::InterfaceManager::append(std::string name,Interface* interface) { Interface* result = findPtr(name); if(result != NULL) return -1; interfaces.push_back(interface); names.push_back(name); return 1; }
shared_ptr<Shape> Space::segmentQueryFirst(Vect a, Vect b, Layers layers, Group group, SegmentQueryInfo* const info) const { cpSegmentQueryInfo i; cpShapeFilter filter{static_cast<cpGroup>(group), static_cast<cpBitmask>(layers), static_cast<cpBitmask>(layers)}; auto rtn = cpSpaceSegmentQueryFirst(space, a, b, 0, filter, &i); if (info) { info->t = i.alpha; info->n = i.normal; } return findPtr(rtn); }