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

Function re_node_set_init_copy

compat/regex/regex_internal.c:1036–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034 }
1035 return REG_NOERROR;
1036}
1037
1038static reg_errcode_t
1039internal_function
1040re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
1041{
1042 dest->nelem = src->nelem;
1043 if (src->nelem > 0)
1044 {
1045 dest->alloc = dest->nelem;
1046 dest->elems = re_malloc (int, dest->alloc);
1047 if (BE (dest->elems == NULL, 0))
1048 {
1049 dest->alloc = dest->nelem = 0;
1050 return REG_ESPACE;
1051 }
1052 memcpy (dest->elems, src->elems, src->nelem * sizeof (int));
1053 }
1054 else
1055 re_node_set_init_empty (dest);
1056 return REG_NOERROR;
1057}
1058

Callers 8

re_node_set_init_unionFunction · 0.85
create_ci_newstateFunction · 0.85
create_cd_newstateFunction · 0.85
internal_functionFunction · 0.85
sift_states_bkrefFunction · 0.85
expand_bkref_cacheFunction · 0.85
create_initial_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected