Skip to content

Commit

Permalink
Separate checks for batch contents when inserting objects in central …
Browse files Browse the repository at this point in the history
…freelist.

That way, we know if the failures are due to empty batch or if transfer cache is trying to insert > kkMaxObjectsToMove objects.

PiperOrigin-RevId: 571357418
Change-Id: I1865790c695c1d2d14b4cbc7ee251704e41fc5e5
  • Loading branch information
v-gogte authored and copybara-github committed Oct 6, 2023
1 parent b27218c commit a1a7c2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tcmalloc/central_freelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ inline size_t CentralFreeList<Forwarder>::NumSpansInList(int n) {

template <class Forwarder>
inline void CentralFreeList<Forwarder>::InsertRange(absl::Span<void*> batch) {
CHECK_CONDITION(!batch.empty() && batch.size() <= kMaxObjectsToMove);
CHECK_CONDITION(!batch.empty());
CHECK_CONDITION(batch.size() <= kMaxObjectsToMove);
Span* spans[kMaxObjectsToMove];
// First, map objects to spans and prefetch spans outside of our mutex
// (to reduce critical section size and cache misses).
Expand Down

0 comments on commit a1a7c2c

Please sign in to comment.