MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / init_sets

Function init_sets

extra/replace.c:676–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674
675
676static int init_sets(REP_SETS *sets,uint states)
677{
678 memset(sets, 0, sizeof(*sets));
679 sets->size_of_bits=((states+7)/8);
680 if (!(sets->set_buffer=(REP_SET*) my_malloc(sizeof(REP_SET)*SET_MALLOC_HUNC,
681 MYF(MY_WME))))
682 return 1;
683 if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits*
684 SET_MALLOC_HUNC,MYF(MY_WME))))
685 {
686 my_free(sets->set);
687 return 1;
688 }
689 return 0;
690}
691
692 /* Make help sets invisible for nicer codeing */
693

Callers 1

init_replaceFunction · 0.85

Calls 2

my_mallocFunction · 0.85
my_freeFunction · 0.85

Tested by

no test coverage detected