MCPcopy Create free account
hub / github.com/MariaDB/server / debug_sync_find

Function debug_sync_find

sql/debug_sync.cc:628–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626*/
627
628static st_debug_sync_action *debug_sync_find(st_debug_sync_action *actionarr,
629 int quantity,
630 const char *dsp_name,
631 size_t name_len)
632{
633 st_debug_sync_action *action;
634 int low ;
635 int high ;
636 int mid ;
637 ssize_t diff ;
638 DBUG_ASSERT(actionarr);
639 DBUG_ASSERT(dsp_name);
640 DBUG_ASSERT(name_len);
641
642 low= 0;
643 high= quantity;
644
645 while (low < high)
646 {
647 mid= (low + high) / 2;
648 action= actionarr + mid;
649 if (!(diff= name_len - action->sync_point.length()) &&
650 !(diff= memcmp(dsp_name, action->sync_point.ptr(), name_len)))
651 return action;
652 if (diff > 0)
653 low= mid + 1;
654 else
655 high= mid - 1;
656 }
657
658 if (low < quantity)
659 {
660 action= actionarr + low;
661 if ((name_len == action->sync_point.length()) &&
662 !memcmp(dsp_name, action->sync_point.ptr(), name_len))
663 return action;
664 }
665
666 return NULL;
667}
668
669
670/**

Callers 2

debug_sync_get_actionFunction · 0.85
debug_syncFunction · 0.85

Calls 2

lengthMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected