Skip to content

Commit c60920f

Browse files
pbhandar2facebook-github-bot
authored andcommitted
Return after XDCHECK when avgObjSize=0 so debug env can fail
Summary: move check and return for avgobjSize = 0 after XDCHECK to let debug fail Reviewed By: byahn0996 Differential Revision: D73970656 fbshipit-source-id: 70b6aacdb9ce7e0e3bca240eeb13eb88183fb5ca
1 parent 0d5ab80 commit c60920f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cachelib/object_cache/ObjectCacheSizeController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ void ObjectCacheSizeController<AllocatorT>::work() {
140140
// First thing, we want to take care of is to make sure that the total
141141
// object size and number of objects are within the limit.
142142
auto averageObjSize = totalObjSize / currentNumEntries;
143+
XDCHECK_NE(0u, averageObjSize);
143144
if (averageObjSize == 0) {
144145
return;
145146
}
146-
XDCHECK_NE(0u, averageObjSize);
147147
auto newEntriesLimit =
148148
objCache_.config_.totalObjectSizeLimit / averageObjSize;
149149

0 commit comments

Comments
 (0)