MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / getfree

Method getfree

src/LNLib/Algorithm/Voronoi.cpp:661–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661char* LNLib::VoronoiDiagramGenerator::getfree(struct Freelist* fl)
662{
663 int i;
664 struct Freenode* t;
665
666 if (fl->head == (struct Freenode*)NULL)
667 {
668 t = (struct Freenode*)myalloc(sqrt_nsites * fl->nodesize);
669
670 if (t == 0)
671 return 0;
672
673 currentMemoryBlock->next = new FreeNodeArrayList;
674 currentMemoryBlock = currentMemoryBlock->next;
675 currentMemoryBlock->memory = t;
676 currentMemoryBlock->next = 0;
677
678 for (i = 0; i < sqrt_nsites; i += 1)
679 makefree((struct Freenode*)((char*)t + i * fl->nodesize), fl);
680 };
681 t = fl->head;
682 fl->head = (fl->head)->nextfree;
683 return((char*)t);
684}
685
686void LNLib::VoronoiDiagramGenerator::makefree(struct Freenode* curr, struct Freelist* fl)
687{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected