Package one.nio.mem
Class ArenaAllocator
- java.lang.Object
-
- one.nio.mem.ArenaAllocator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classArenaAllocator.Arena
-
Field Summary
Fields Modifier and Type Field Description private longaccumulatedBytesprivate ArenaAllocator.Arenacurrentprivate static longMIN_ARENA_SIZE
-
Constructor Summary
Constructors Constructor Description ArenaAllocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcalloc(int size)voidfree(long address)longgetAllocatedBytes()protected longgetMemoryFromSystem(long size)private ArenaAllocator.ArenagetNextArena(ArenaAllocator.Arena current, long size)longgetReservedBytes()longmalloc(int size)voidrelease()protected voidreleaseMemoryToSystem(long addr, long size)voidverify()Verify the layout of the heap.
-
-
-
Field Detail
-
MIN_ARENA_SIZE
private static final long MIN_ARENA_SIZE
- See Also:
- Constant Field Values
-
current
private volatile ArenaAllocator.Arena current
-
accumulatedBytes
private long accumulatedBytes
-
-
Method Detail
-
release
public void release()
-
verify
public void verify()
Description copied from interface:AllocatorVerify the layout of the heap. Expensive operation, used only for debugging purposes.
-
getNextArena
private ArenaAllocator.Arena getNextArena(ArenaAllocator.Arena current, long size)
-
getMemoryFromSystem
protected long getMemoryFromSystem(long size)
-
releaseMemoryToSystem
protected void releaseMemoryToSystem(long addr, long size)
-
getAllocatedBytes
public long getAllocatedBytes()
-
getReservedBytes
public long getReservedBytes()
-
-