GenericByteArrayPool.smali
.class public Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;
.super Lcom/facebook/imagepipeline/memory/BasePool;
.source "GenericByteArrayPool.java"
# interfaces
.implements Lcom/facebook/common/memory/ByteArrayPool;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/facebook/imagepipeline/memory/BasePool<",
"[B>;",
"Lcom/facebook/common/memory/ByteArrayPool;"
}
.end annotation
.annotation build Ljavax/annotation/concurrent/ThreadSafe;
.end annotation
# instance fields
.field public final mBucketSizes:[I
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>(Lcom/facebook/common/memory/MemoryTrimmableRegistry;Lcom/facebook/imagepipeline/memory/PoolParams;Lcom/facebook/imagepipeline/memory/PoolStatsTracker;)V
.registers 5
invoke-direct {p0, p1, p2, p3}, Lcom/facebook/imagepipeline/memory/BasePool;-><init>(Lcom/facebook/common/memory/MemoryTrimmableRegistry;Lcom/facebook/imagepipeline/memory/PoolParams;Lcom/facebook/imagepipeline/memory/PoolStatsTracker;)V
iget-object p1, p2, Lcom/facebook/imagepipeline/memory/PoolParams;->bucketSizes:Landroid/util/SparseIntArray;
invoke-virtual {p1}, Landroid/util/SparseIntArray;->size()I
move-result p2
new-array p2, p2, [I
iput-object p2, p0, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->mBucketSizes:[I
const/4 p2, 0x0
:goto_e
invoke-virtual {p1}, Landroid/util/SparseIntArray;->size()I
move-result p3
if-ge p2, p3, :cond_1f
iget-object p3, p0, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->mBucketSizes:[I
invoke-virtual {p1, p2}, Landroid/util/SparseIntArray;->keyAt(I)I
move-result v0
aput v0, p3, p2
add-int/lit8 p2, p2, 0x1
goto :goto_e
:cond_1f
invoke-virtual {p0}, Lcom/facebook/imagepipeline/memory/BasePool;->initialize()V
return-void
.end method
# virtual methods
.method public bridge synthetic alloc(I)Ljava/lang/Object;
.registers 2
invoke-virtual {p0, p1}, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->alloc(I)[B
move-result-object p1
return-object p1
.end method
.method public alloc(I)[B
.registers 2
new-array p1, p1, [B
return-object p1
.end method
.method public bridge synthetic free(Ljava/lang/Object;)V
.registers 2
check-cast p1, [B
invoke-virtual {p0, p1}, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->free([B)V
return-void
.end method
.method public free([B)V
.registers 2
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
return-void
.end method
.method public getBucketedSize(I)I
.registers 6
if-lez p1, :cond_11
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->mBucketSizes:[I
array-length v1, v0
const/4 v2, 0x0
:goto_6
if-ge v2, v1, :cond_10
aget v3, v0, v2
if-lt v3, p1, :cond_d
return v3
:cond_d
add-int/lit8 v2, v2, 0x1
goto :goto_6
:cond_10
return p1
:cond_11
new-instance v0, Lcom/facebook/imagepipeline/memory/BasePool$InvalidSizeException;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
invoke-direct {v0, p1}, Lcom/facebook/imagepipeline/memory/BasePool$InvalidSizeException;-><init>(Ljava/lang/Object;)V
goto :goto_1c
:goto_1b
throw v0
:goto_1c
goto :goto_1b
.end method
.method public bridge synthetic getBucketedSizeForValue(Ljava/lang/Object;)I
.registers 2
check-cast p1, [B
invoke-virtual {p0, p1}, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->getBucketedSizeForValue([B)I
move-result p1
return p1
.end method
.method public getBucketedSizeForValue([B)I
.registers 2
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
array-length p1, p1
return p1
.end method
.method public getMinBufferSize()I
.registers 3
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/GenericByteArrayPool;->mBucketSizes:[I
const/4 v1, 0x0
aget v0, v0, v1
return v0
.end method
.method public getSizeInBytes(I)I
.registers 2
return p1
.end method