Class TlsfAllocator
java.lang.Object
com.mojang.blaze3d.vertex.TlsfAllocator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classstatic classprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate intprivate final @Nullable TlsfAllocator.Block[]private static final org.slf4j.Loggerprivate static final longprivate static final intprivate static final intprivate final int[]private static final intprivate final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longalignDown(long x, long align) private static longalignUp(long x, long align) @Nullable TlsfAllocator.Allocationallocate(long size, int align) private static intfindFirstSignificantBit(int x) private static intfindLastSignificantBit(long x) voidfree(TlsfAllocator.Allocation allocation) private @Nullable TlsfAllocator.BlockgetBlockFromFreeList(int firstLevelIndex, int secondLevelIndex) private TlsfAllocator.IndexPairgetLevelIndex(long size) private voidbooleanprivate TlsfAllocator.IndexPairmappingSearch(long size) private voidprivate voidvoidprivate voidremoveFreeBlock(TlsfAllocator.Block block, int firstLevel, int secondLevel) private voidsetBlockFreeList(int firstLevelIndex, int secondLevelIndex, @Nullable TlsfAllocator.Block block) private voidtrimBlock(TlsfAllocator.Block block, long size)
-
Field Details
-
SECOND_LEVEL_BIN_LOG2
private static final int SECOND_LEVEL_BIN_LOG2- See Also:
-
SECOND_LEVEL_BIN_COUNT
private static final int SECOND_LEVEL_BIN_COUNT- See Also:
-
FIRST_LEVEL_INDEX_SHIFT
private static final int FIRST_LEVEL_INDEX_SHIFT- See Also:
-
FIRST_LEVEL_BIN_COUNT
private static final int FIRST_LEVEL_BIN_COUNT- See Also:
-
SMALL_BLOCK_SIZE
private static final int SMALL_BLOCK_SIZE- See Also:
-
MAX_ALLOCATION_SIZE
private static final long MAX_ALLOCATION_SIZE- See Also:
-
ALIGN_SIZE
private static final int ALIGN_SIZE- See Also:
-
firstLevelBitmap
private int firstLevelBitmap -
secondLevelBitmap
private final int[] secondLevelBitmap -
freeLists
-
totalMemorySize
private final long totalMemorySize -
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
TlsfAllocator
-
-
Method Details
-
getBlockFromFreeList
private @Nullable TlsfAllocator.Block getBlockFromFreeList(int firstLevelIndex, int secondLevelIndex) -
setBlockFreeList
private void setBlockFreeList(int firstLevelIndex, int secondLevelIndex, @Nullable TlsfAllocator.Block block) -
alignUp
private static long alignUp(long x, long align) -
alignDown
private static long alignDown(long x, long align) -
findLastSignificantBit
private static int findLastSignificantBit(long x) -
findFirstSignificantBit
private static int findFirstSignificantBit(int x) -
getLevelIndex
-
mappingSearch
-
insertFreeBlock
-
removeFreeBlock
-
trimBlock
-
allocate
-
mergeBlockWithPrevious
-
mergeBlockWithNext
-
free
-
isCompletelyFree
public boolean isCompletelyFree() -
printAllocatorStatistics
-