MCPcopy Create free account
hub / github.com/git/git / re_node_set_alloc

Function re_node_set_alloc

compat/regex/regex_internal.c:968–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

966
967
968/* Functions for set operation. */
969
970static reg_errcode_t
971internal_function
972re_node_set_alloc (re_node_set *set, int size)
973{
974 /*
975 * ADR: valgrind says size can be 0, which then doesn't
976 * free the block of size 0. Harumph. This seems
977 * to work ok, though.
978 */
979 if (size == 0)
980 {
981 memset(set, 0, sizeof(*set));
982 return REG_NOERROR;
983 }
984 set->alloc = size;
985 set->nelem = 0;
986 set->elems = re_malloc (int, size);
987 if (BE (set->elems == NULL, 0))
988 return REG_ESPACE;
989 return REG_NOERROR;
990}
991

Callers 6

register_stateFunction · 0.85
add_epsilon_src_nodesFunction · 0.85
transit_state_sbFunction · 0.85
check_arrival_expand_eclFunction · 0.85
internal_functionFunction · 0.85
calc_eclosure_iterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected