void Arena::walk() const { for (const auto &chunk : chunks_used) printchunk(chunk.first, chunk.second, true); std::cout << std::endl; for (const auto &chunk : chunks_free) printchunk(chunk.first, chunk.second, false); std::cout << std::endl; }
/* find the named chunk and call printchunk on it */ int getchunk(char *chunkname) { int i; int j; int linelen; int chunklen = strlen(chunkname); if (DEBUG==3) { printf("getchunk(%s)\n",chunkname); } for (i=0; ((linelen=nextline(i)) != -1); ) { if (DEBUG==2) { printf("----"); printline(i,linelen); printf("----\n"); } if ((linelen >= chunklen+15) && (foundchunk(i,chunkname) == 1)) { if (DEBUG==2) { fprintf(stderr,"=================\\getchunk(%s)\n",chunkname); } i=printchunk(i,linelen,chunkname); } else { i=i+linelen+1; } } if (DEBUG==2) { fprintf(stderr,"=================getchunk returned=%d\n",i); } return(i); }