public static void pushMemoryPool(int size) { Pool original = CURRENT_POOL.get(); Pool next = new Pool(size, original); CURRENT_POOL.set(next); }
public static void popMemoryPool() { Pool next = CURRENT_POOL.get(); next.delete(); if( next.prev == null ) { CURRENT_POOL.remove(); } else { CURRENT_POOL.set(next.prev); } }
NativeBuffer create(long size) { if( size >= chunk ) { Allocation allocation = new Allocation(size); return new NativeBuffer(allocation, allocation.self, size); } if( remaining < size ) { delete(); } if( allocation == null ) { allocate(); } NativeBuffer rc = new NativeBuffer(allocation, pos, size); pos = PointerMath.add(pos, size); remaining -= size; return rc; }
NativeBuffer create(long size) { if( size >= chunk ) { Allocation allocation = new Allocation(size); return new NativeBuffer(allocation, allocation.self, size); } if( remaining < size ) { delete(); } if( allocation == null ) { allocate(); } NativeBuffer rc = new NativeBuffer(allocation, pos, size); pos = PointerMath.add(pos, size); remaining -= size; return rc; }
NativeBuffer create(long size) { if( size >= chunk ) { Allocation allocation = new Allocation(size); return new NativeBuffer(allocation, allocation.self, size); } if( remaining < size ) { delete(); } if( allocation == null ) { allocate(); } NativeBuffer rc = new NativeBuffer(allocation, pos, size); pos = PointerMath.add(pos, size); remaining -= size; return rc; }
static public NativeBuffer create(long capacity) { Pool pool = CURRENT_POOL.get(); if( pool == null ) { Allocation allocation = new Allocation(capacity); return new NativeBuffer(allocation, allocation.self, capacity); } else { return pool.create(capacity); } }
public static void popMemoryPool() { Pool next = CURRENT_POOL.get(); next.delete(); if( next.prev == null ) { CURRENT_POOL.remove(); } else { CURRENT_POOL.set(next.prev); } }
static public NativeBuffer create(long capacity) { Pool pool = CURRENT_POOL.get(); if( pool == null ) { Allocation allocation = new Allocation(capacity); return new NativeBuffer(allocation, allocation.self, capacity); } else { return pool.create(capacity); } }
public static void pushMemoryPool(int size) { Pool original = CURRENT_POOL.get(); Pool next = new Pool(size, original); CURRENT_POOL.set(next); }
public static void popMemoryPool() { Pool next = CURRENT_POOL.get(); next.delete(); if( next.prev == null ) { CURRENT_POOL.remove(); } else { CURRENT_POOL.set(next.prev); } }
public static void pushMemoryPool(int size) { Pool original = CURRENT_POOL.get(); Pool next = new Pool(size, original); CURRENT_POOL.set(next); }
static public NativeBuffer create(long capacity) { Pool pool = CURRENT_POOL.get(); if( pool == null ) { Allocation allocation = new Allocation(capacity); return new NativeBuffer(allocation, allocation.self, capacity); } else { return pool.create(capacity); } }