MCPcopy Create free account
hub / github.com/beefytech/Beef / FindFreeRange

Method FindFreeRange

BeefySysLib/util/AllocDebug.cpp:97–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 int FindFreeRange(int numPages, int from, int to)
98 {
99 int lastUsedIdx = from - 1;
100 for (int pageIdx = from; pageIdx < to; pageIdx++)
101 {
102 if (mUsedBits.IsSet(pageIdx))
103 {
104 lastUsedIdx = pageIdx;
105 }
106 else if (pageIdx - lastUsedIdx >= numPages)
107 {
108 return lastUsedIdx + 1;
109 }
110 }
111 return -1;
112 }
113
114 void* Alloc(int size)
115 {

Callers

nothing calls this directly

Calls 1

IsSetMethod · 0.45

Tested by

no test coverage detected