Skip to content

Commit d3a7c46

Browse files
Nitin Gargfacebook-github-bot
authored andcommitted
Dont do expensive dcheck in hot path
Summary: recent change to cache TL element pointer in its ThreadEntrySet added more paths where debug builds check the consistency of the set. The checks can become expensive. Remove them from the checks done in get / reset paths. Reviewed By: sarangbh, bikash-c Differential Revision: D76601252 fbshipit-source-id: 5d1c875a276279ed302099267f7e55066e3fdbb3
1 parent 56c0963 commit d3a7c46

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

third-party/folly/src/folly/detail/ThreadLocalDetail.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ struct ThreadEntrySet {
357357
}
358358

359359
int64_t getIndexFor(ThreadEntry* entry) const {
360-
DCHECK(basicSanity());
361360
auto iter = entryToVectorSlot.find(entry);
362361
if (iter != entryToVectorSlot.end()) {
363362
return static_cast<int64_t>(iter->second);
@@ -371,7 +370,6 @@ struct ThreadEntrySet {
371370
* ElementWrapper array used for fast access from the thread itself.
372371
*/
373372
void* getPtrForThread(ThreadEntry* entry) const {
374-
DCHECK(basicSanity());
375373
auto index = getIndexFor(entry);
376374
if (index < 0) {
377375
return nullptr;

0 commit comments

Comments
 (0)