MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / powerOf2

Function powerOf2

source/util/bnativeheap.cpp:24–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#define BNATIVEHEAD_64K_BLOCK_SIZE (64 * 1024)
23
24static int powerOf2(U32 requestedSize) {
25 U32 powerOf2Size = 1;
26 U32 size = 2;
27 while (size < requestedSize) {
28 size <<= 1;
29 powerOf2Size++;
30 }
31 return powerOf2Size;
32}
33
34void BNativeHeap::freeAll() {
35 for (auto& block : blocks) {

Callers 1

allocMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected