SubPool getSubPool(long limit, float cleanThreshold) { return new SubPool(limit, cleanThreshold); }
private void acquired(long size) { parent.acquired(size); ownsUpdater.addAndGet(this, size); }
void released(long size) { assert size >= 0; adjustAllocated(-size); hasRoom.signalAll(); }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register()); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
void acquired(long size) { maybeClean(); }
void acquired(long size) { maybeClean(); }
protected NativeAllocator(NativePool pool) { super(pool.onHeap.newAllocator(), pool.offHeap.newAllocator()); }
SubPool getSubPool(long limit, float cleanThreshold) { return new SubPool(limit, cleanThreshold); }
Allocator(HeapPool pool) { super(pool.onHeap.newAllocator(), pool.offHeap.newAllocator()); }
boolean needsCleaning() { return pool.onHeap.needsCleaning() || pool.offHeap.needsCleaning(); }
boolean needsCleaning() { return pool.onHeap.needsCleaning() || pool.offHeap.needsCleaning(); }
SubPool getSubPool(long limit, float cleanThreshold) { return new SubPool(limit, cleanThreshold); }
Allocator(HeapPool pool) { super(pool.onHeap.newAllocator(), pool.offHeap.newAllocator()); }
protected NativeAllocator(NativePool pool) { super(pool.onHeap.newAllocator(), pool.offHeap.newAllocator()); }
public MemtableAllocator newAllocator() { return new SlabAllocator(onHeap.newAllocator(), offHeap.newAllocator(), allocateOnHeap); }
boolean needsCleaning() { return pool.onHeap.needsCleaning() || pool.offHeap.needsCleaning(); }