static Event *allocateEvent() { if (eventMemory == NULL) eventMemory = newRecycleBin(sizeof(Event), BLOCK_SIZE); return allocatePointer(eventMemory); }
static Mask *allocateMask(SequencesWriter *seqWriteInfo) { if (seqWriteInfo->m_maskMemory == NULL) seqWriteInfo->m_maskMemory = newRecycleBin(sizeof(Mask), 10000); return (Mask *) allocatePointer(seqWriteInfo->m_maskMemory); }
static Mask *allocateMask() { if (maskMemory == NULL) maskMemory = newRecycleBin(sizeof(Mask), 10000); return (Mask *) allocatePointer(maskMemory); }
static Connection *allocateConnection() { if (connectionMemory == NULL) connectionMemory = newRecycleBin(sizeof(Connection), BLOCK_SIZE); return allocatePointer(connectionMemory); }
Transcript *allocateTranscript() { if (transcriptMemory == NULL) transcriptMemory = newRecycleBin(sizeof(Transcript), BLOCK_SIZE); return (Transcript*)allocatePointer(transcriptMemory); }
static SmallNodeList *allocateSmallNodeList() { if (smallNodeListMemory == NULL) smallNodeListMemory = newRecycleBin(sizeof(SmallNodeList), BLOCKSIZE); return allocatePointer(smallNodeListMemory); }
static NodeList *allocateNodeList() { if (nodeListMemory == NULL) nodeListMemory = newRecycleBin(sizeof(NodeList), BLOCK_SIZE); return (NodeList*)allocatePointer(nodeListMemory); }
static RBConnection *allocateRBConnection() { if (nodeListMemory == NULL) nodeListMemory = newRecycleBin(sizeof(RBConnection), BLOCKSIZE); return allocatePointer(nodeListMemory); }
void readCoherentGraph(Graph * inGraph, boolean(*isUnique) (Node * node), double coverage, ReadSet * reads) { IDnum nodeIndex; Node *node; IDnum previousNodeCount = 0; graph = inGraph; listMemory = newRecycleBin(sizeof(PassageMarkerList), 100000); expected_coverage = coverage; sequences = reads->tSequences; velvetLog("Read coherency...\n"); resetNodeStatus(graph); identifyUniqueNodes(isUnique); trimLongReadTips(); previousNodeCount = 0; while (previousNodeCount != nodeCount(graph)) { previousNodeCount = nodeCount(graph); for (nodeIndex = 1; nodeIndex <= nodeCount(graph); nodeIndex++) { node = getNodeInGraph(graph, nodeIndex); if (node == NULL || !getUniqueness(node)) continue; while (uniqueNodesConnect(node)) node = bypass(); node = getTwinNode(node); while (uniqueNodesConnect(node)) node = bypass(); } renumberNodes(graph); } destroyRecycleBin(listMemory); destroyRecycleBin(nodeListMemory); velvetLog("Confronted to %li multiple hits and %li null over %li\n", (long) multCounter, (long) nullCounter, (long) dbgCounter); velvetLog("Read coherency over!\n"); }
/* * Public Heap Functions */ DFibHeap *dfh_makekeyheap() { DFibHeap *n; if ((n = (DFibHeap*)malloc(sizeof *n)) == NULL) return NULL; n->nodeMemory = newRecycleBin(sizeof(DFibHeapNode), BLOCKSIZE); n->dfh_n = 0; n->dfh_Dl = -1; n->dfh_cons = NULL; n->dfh_min = NULL; n->dfh_root = NULL; return n; }
static SplayNode *allocateSplayNode() { #ifdef OPENMP #ifdef DEBUG if (treeMemory == NULL) { velvetLog("The memory for splay trees seems uninitialised, " "this is probably a bug, aborting.\n"); abort(); } #endif return allocatePointer(getRecycleBinInArray(treeMemory, omp_get_thread_num())); #else if (treeMemory == NULL) treeMemory = newRecycleBin(sizeof(SplayNode), CHUNKSIZE); return allocatePointer(treeMemory); #endif }
static SmallNodeList *allocateSmallNodeList() { #ifdef OPENMP #ifdef DEBUG if (smallNodeListMemory == NULL) { velvetLog("The memory for small nodes seems uninitialised, " "this is probably a bug, aborting.\n"); abort(); } #endif return allocatePointer(getRecycleBinInArray(smallNodeListMemory, omp_get_thread_num())); #else if (smallNodeListMemory == NULL) smallNodeListMemory = newRecycleBin(sizeof(SmallNodeList), BLOCKSIZE); return allocatePointer(smallNodeListMemory); #endif }