MCPcopy
hub / github.com/libgdx/libgdx / fill

Method fill

gdx/src/com/badlogic/gdx/utils/Pool.java:75–79  ·  view source on GitHub ↗

Adds the specified number of new free objects to the pool. Usually called early on as a pre-allocation mechanism but can be used at any time. @param size the number of objects to be added

(int size)

Source from the content-addressed store, hash-verified

73 *
74 * @param size the number of objects to be added */
75 public void fill (int size) {
76 for (int i = 0; i < size; i++)
77 if (freeObjects.size < max) freeObjects.add(newObject());
78 peak = Math.max(peak, freeObjects.size);
79 }
80
81 /** Called when an object is freed to clear the state of the object for possible later reuse. The default implementation calls
82 * {@link Poolable#reset()} if the object is {@link Poolable}. */

Callers 15

createMethod · 0.45
createMethod · 0.45
createMethod · 0.45
createMethod · 0.45
createMethod · 0.45
renderMethod · 0.45
createMethod · 0.45
renderMethod · 0.45
drawDebugTextureMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
drawGlyphMethod · 0.45

Calls 3

newObjectMethod · 0.95
addMethod · 0.65
maxMethod · 0.45

Tested by 9

createMethod · 0.36
createMethod · 0.36
createMethod · 0.36
createMethod · 0.36
createMethod · 0.36
renderMethod · 0.36
createMethod · 0.36
renderMethod · 0.36
drawDebugTextureMethod · 0.36