long allocated = getAllocatedSize(); fireThresholds(allocated - size, allocated);
long allocated = getAllocatedSize(); fireThresholds(allocated - size, allocated);
/** * Frees the supplied buffer. * <p> * If the given buffer was not allocated by this source or has already been * freed then an {@code AssertionError} is thrown. */ @Override public synchronized void free(Page page) { if (page.isFreeable()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Freeing a {}B buffer from chunk {} &{}", DebuggingUtils.toBase2SuffixedString(page.size()), page.index(), page.address()); } markAllAvailable(); sliceAllocators.get(page.index()).free(page.address(), page.size()); victims.get(page.index()).remove(page); victimAllocators.get(page.index()).tryFree(page.address(), page.size()); if (!fallingThresholds.isEmpty()) { long allocated = getAllocatedSize(); fireThresholds(allocated + page.size(), allocated); } } }
/** * Frees the supplied buffer. * <p> * If the given buffer was not allocated by this source or has already been * freed then an {@code AssertionError} is thrown. */ @Override public synchronized void free(Page page) { if (page.isFreeable()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Freeing a {}B buffer from chunk {} &{}", DebuggingUtils.toBase2SuffixedString(page.size()), page.index(), page.address()); } markAllAvailable(); sliceAllocators.get(page.index()).free(page.address(), page.size()); victims.get(page.index()).remove(page); victimAllocators.get(page.index()).tryFree(page.address(), page.size()); if (!fallingThresholds.isEmpty()) { long allocated = getAllocatedSize(); fireThresholds(allocated + page.size(), allocated); } } }