fix style violations

This commit is contained in:
lax1dude 2024-11-02 21:05:25 -07:00
parent a5836dff25
commit fec6caa10f

View File

@ -285,7 +285,8 @@ public final class LaxMalloc {
return ret; return ret;
} }
}while((addrIterator = readChunkNextFreeAddr(addrIterator)).getInt() != chunkPtr.getInt()); addrIterator = readChunkNextFreeAddr(addrIterator);
} while (addrIterator.getInt() != chunkPtr.getInt());
} }
// no free huge chunks found, time to sbrk // no free huge chunks found, time to sbrk
@ -487,12 +488,14 @@ public final class LaxMalloc {
} }
/** /**
* https://github.com/emscripten-core/emscripten/blob/16a0bf174cb85f88b6d9dcc8ee7fbca59390185b/system/lib/emmalloc.c#L241 * https://github.com/emscripten-core/emscripten/blob/16a0bf174cb85f88b6d9dcc8ee7fbca59390185b/system/
* lib/emmalloc.c#L241
* (MIT License) * (MIT License)
*/ */
private static int getListBucket(int allocSize) { private static int getListBucket(int allocSize) {
if (allocSize < 128) if (allocSize < 128) {
return (allocSize >> 3) - 1; return (allocSize >> 3) - 1;
}
int clz = Integer.numberOfLeadingZeros(allocSize); int clz = Integer.numberOfLeadingZeros(allocSize);
int bucketIndex = (clz > 19) ? 110 - (clz << 2) + ((allocSize >> (29 - clz)) ^ 4) int bucketIndex = (clz > 19) ? 110 - (clz << 2) + ((allocSize >> (29 - clz)) ^ 4)