static void release(StateUpdatesHolder pendingStateUpdates) { pendingStateUpdates.release(); sStateUpdatesHolderPool.release(pendingStateUpdates); } }
static TestOutput acquireTestOutput() { if (sTestOutputPool == null) { sTestOutputPool = new RecyclePool<>("TestOutput", 64, true); } TestOutput output = ComponentsConfiguration.disablePools ? null : sTestOutputPool.acquire(); if (output == null) { output = new TestOutput(); } return output; }
@Test public void testClear() { final RecyclePool<Object> pool = new RecyclePool<>("test", 10, false); final int ELEMENT_NUM = 7; for (int i = 0; i < ELEMENT_NUM; i++) { pool.release(new Object()); } assertEquals(ELEMENT_NUM, pool.getCurrentSize()); pool.clear(); assertEquals(0, pool.getCurrentSize()); } }
sLayoutStatePool.clear(); sYogaNodePool.clear(); sInternalNodePool.clear(); sNodeInfoPool.clear(); sViewNodeInfoPool.clear(); sMountItemPool.clear(); sLayoutOutputPool.clear(); sVisibilityOutputPool.clear(); sVisibilityItemPool.clear(); if (sTestOutputPool != null) { sTestOutputPool.clear(); sTestItemPool.clear(); sOutputPool.clear(); sDiffNodePool.clear(); sDiffPool.clear(); sComponentTreeBuilderPool.clear(); sStateHandlerPool.clear(); sMountItemScrapArrayPool.clear(); sRectFPool.clear(); sEdgesPool.clear(); sDisplayListDrawablePool.clear(); sArraySetPool.clear(); sArrayDequePool.clear(); sRenderStatePool.clear(); sLithoViewArrayListPool.clear();
public static ArrayList<LithoView> acquireLithoViewArrayList() { ArrayList<LithoView> arrayList = ComponentsConfiguration.disablePools ? null : sLithoViewArrayListPool.acquire(); if (arrayList == null) { arrayList = new ArrayList<>(5); } return arrayList; }
@ThreadSafe(enableChecks = false) public static void release(ArrayList<LithoView> arrayList) { if (ComponentsConfiguration.disablePools) { return; } arrayList.clear(); sLithoViewArrayListPool.release(arrayList); }
static TestItem acquireTestItem() { if (sTestItemPool == null) { sTestItemPool = new RecyclePool<>("TestItem", 64, true); } TestItem item = ComponentsConfiguration.disablePools ? null : sTestItemPool.acquire(); if (item == null) { item = new TestItem(); } item.setAcquired(); return item; }
public static <E> ArrayDeque<E> acquireArrayDeque() { ArrayDeque<E> deque = ComponentsConfiguration.disablePools ? null : sArrayDequePool.acquire(); if (deque == null) { deque = new ArrayDeque<>(); } return deque; }
@ThreadSafe(enableChecks = false) static void release(LayoutState state) { sLayoutStatePool.release(state); }
static Rect acquireRect() { Rect rect = ComponentsConfiguration.disablePools ? null : sRectPool.acquire(); if (rect == null) { rect = new Rect(); } return rect; }
@ThreadSafe(enableChecks = false) static void release(LayoutOutput output) { sLayoutOutputPool.release(output); }
static RectF acquireRectF() { RectF rect = ComponentsConfiguration.disablePools ? null : sRectFPool.acquire(); if (rect == null) { rect = new RectF(); } return rect; }
@ThreadSafe(enableChecks = false) static void release(InternalNode node) { sInternalNodePool.release(node); }
static StateUpdatesHolder acquireStateUpdatesHolder() { StateUpdatesHolder pendingStateUpdates = sStateUpdatesHolderPool.acquire(); if (pendingStateUpdates == null) { pendingStateUpdates = new StateUpdatesHolder(); } return pendingStateUpdates; }
@ThreadSafe(enableChecks = false) static void release(ViewNodeInfo viewNodeInfo) { sViewNodeInfoPool.release(viewNodeInfo); }
static ViewNodeInfo acquireViewNodeInfo() { ViewNodeInfo viewNodeInfo = ComponentsConfiguration.disablePools ? null : sViewNodeInfoPool.acquire(); if (viewNodeInfo == null) { viewNodeInfo = new ViewNodeInfo(); } return viewNodeInfo; }
@ThreadSafe(enableChecks = false) static void releaseScrapMountItemsArray(SparseArrayCompat<MountItem> sparseArray) { sMountItemScrapArrayPool.release(sparseArray); }
static NodeInfo acquireNodeInfo() { NodeInfo nodeInfo = ComponentsConfiguration.disablePools ? null : sNodeInfoPool.acquire(); if (nodeInfo == null) { nodeInfo = new NodeInfo(); } return nodeInfo; }
@ThreadSafe(enableChecks = false) static void release(NodeInfo nodeInfo) { sNodeInfoPool.release(nodeInfo); }