Exemplo n.º 1
0
 /** Frees the specified objects from the {@link #get(Class) pool}. */
 public void freeAll(Array objects) {
   if (objects == null) throw new IllegalArgumentException("objects cannot be null.");
   for (int i = 0, n = objects.size; i < n; i++) {
     Object object = objects.get(i);
     ReflectionPool pool = typePools.get(object.getClass());
     if (pool == null) return; // Ignore freeing an object that was never retained.
     pool.free(object);
   }
 }
Exemplo n.º 2
0
 /** Frees an object from the {@link #get(Class) pool}. */
 public void free(Object object) {
   if (object == null) throw new IllegalArgumentException("object cannot be null.");
   ReflectionPool pool = typePools.get(object.getClass());
   if (pool == null) return; // Ignore freeing an object that was never retained.
   pool.free(object);
 }