LruBucketsPoolBackend.smali
.class public abstract Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;
.super Ljava/lang/Object;
.source "LruBucketsPoolBackend.java"
# interfaces
.implements Lcom/facebook/imagepipeline/memory/PoolBackend;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lcom/facebook/imagepipeline/memory/PoolBackend<",
"TT;>;"
}
.end annotation
# instance fields
.field public final mCurrentItems:Ljava/util/Set;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
"TT;>;"
}
.end annotation
.end field
.field public final mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/facebook/imagepipeline/memory/BucketMap<",
"TT;>;"
}
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>()V
.registers 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/HashSet;
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
iput-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mCurrentItems:Ljava/util/Set;
new-instance v0, Lcom/facebook/imagepipeline/memory/BucketMap;
invoke-direct {v0}, Lcom/facebook/imagepipeline/memory/BucketMap;-><init>()V
iput-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
return-void
.end method
.method private maybeRemoveFromCurrentItems(Ljava/lang/Object;)Ljava/lang/Object;
.registers 3
.param p1 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)TT;"
}
.end annotation
if-eqz p1, :cond_d
monitor-enter p0
:try_start_3
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mCurrentItems:Ljava/util/Set;
invoke-interface {v0, p1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
monitor-exit p0
goto :goto_d
:catchall_a
move-exception p1
monitor-exit p0
:try_end_c
.catchall {:try_start_3 .. :try_end_c} :catchall_a
throw p1
:cond_d
:goto_d
return-object p1
.end method
# virtual methods
.method public get(I)Ljava/lang/Object;
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)TT;"
}
.end annotation
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
invoke-virtual {v0, p1}, Lcom/facebook/imagepipeline/memory/BucketMap;->acquire(I)Ljava/lang/Object;
move-result-object p1
invoke-direct {p0, p1}, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->maybeRemoveFromCurrentItems(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
return-object p1
.end method
.method public pop()Ljava/lang/Object;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()TT;"
}
.end annotation
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
invoke-virtual {v0}, Lcom/facebook/imagepipeline/memory/BucketMap;->removeFromEnd()Ljava/lang/Object;
move-result-object v0
invoke-direct {p0, v0}, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->maybeRemoveFromCurrentItems(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public put(Ljava/lang/Object;)V
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
monitor-enter p0
:try_start_1
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mCurrentItems:Ljava/util/Set;
invoke-interface {v0, p1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
move-result v0
monitor-exit p0
:try_end_8
.catchall {:try_start_1 .. :try_end_8} :catchall_14
if-eqz v0, :cond_13
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
invoke-interface {p0, p1}, Lcom/facebook/imagepipeline/memory/PoolBackend;->getSize(Ljava/lang/Object;)I
move-result v1
invoke-virtual {v0, v1, p1}, Lcom/facebook/imagepipeline/memory/BucketMap;->release(ILjava/lang/Object;)V
:cond_13
return-void
:catchall_14
move-exception p1
:try_start_15
monitor-exit p0
:try_end_16
.catchall {:try_start_15 .. :try_end_16} :catchall_14
throw p1
.end method
.method public valueCount()I
.registers 2
.annotation build Lcom/facebook/common/internal/VisibleForTesting;
.end annotation
iget-object v0, p0, Lcom/facebook/imagepipeline/memory/LruBucketsPoolBackend;->mMap:Lcom/facebook/imagepipeline/memory/BucketMap;
invoke-virtual {v0}, Lcom/facebook/imagepipeline/memory/BucketMap;->valueCount()I
move-result v0
return v0
.end method