Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
yh_sdwebimage
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
Olivier Poitrey
2015-05-11 12:48:37 -0700
Commit
98989d9524392e101ad04af492d4f1207158ce00
2 parents
704c6305
f72f4c18
Merge pull request #1140 from rromanchuk/feature/add-count-limits
Add NSCache countLimit property
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
SDWebImage/SDImageCache.h
SDWebImage/SDImageCache.m
SDWebImage/SDImageCache.h
View file @
98989d9
...
...
@@ -48,6 +48,11 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot
@property
(
assign
,
nonatomic
)
NSUInteger
maxMemoryCost
;
/**
* The maximum number of objects the cache should hold.
*/
@property
(
assign
,
nonatomic
)
NSUInteger
maxMemoryCountLimit
;
/**
* The maximum length of time to keep an image in the cache, in seconds
*/
@property
(
assign
,
nonatomic
)
NSInteger
maxCacheAge
;
...
...
SDWebImage/SDImageCache.m
View file @
98989d9
...
...
@@ -377,6 +377,14 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
return
self
.
memCache
.
totalCostLimit
;
}
-
(
NSUInteger
)
maxMemoryCountLimit
{
return
self
.
memCache
.
countLimit
;
}
-
(
void
)
setMaxMemoryCountLimit
:
(
NSUInteger
)
maxCountLimit
{
self
.
memCache
.
countLimit
=
maxCountLimit
;
}
-
(
void
)
clearMemory
{
[
self
.
memCache
removeAllObjects
];
}
...
...
Please
register
or
login
to post a comment