Package arc.util.pooling
Class Pools
java.lang.Object
arc.util.pooling.Pools
Stores a map of
Pools by type for convenient static access.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidFrees an object from thepool.static voidFrees the specified objects from thepool.static voidFrees the specified objects from thepool.static <T> Pool<T>Returns a new or existing pool for the specified type, stored in a Class toPoolmap.static <T> Pool<T>Returns a new or existing pool for the specified type, stored in a Class toPoolmap.static <T> TObtains an object from thepool.static <T> voidSets an existing pool for the specified type, stored in a Class toPoolmap.
-
Method Details
-
get
Returns a new or existing pool for the specified type, stored in a Class toPoolmap. Note that the max size is ignored for some reason. if this is not the first time this pool has been requested. -
get
Returns a new or existing pool for the specified type, stored in a Class toPoolmap. The max size of the pool used is 5000. -
set
Sets an existing pool for the specified type, stored in a Class toPoolmap. -
obtain
Obtains an object from thepool. -
free
Frees an object from thepool. -
freeAll
Frees the specified objects from thepool. Null objects within the array are silently ignored. Objects don't need to be from the same pool. -
freeAll
Frees the specified objects from thepool. Null objects within the array are silently ignored.- Parameters:
samePool- If true, objects don't need to be from the same pool but the pool must be looked up for each object.
-