MCPcopy Create free account
hub / github.com/boostorg/build / list_append

Function list_append

v2/engine/lists.c:60–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 */
59
60LIST * list_append( LIST * l, LIST * nl )
61{
62 if ( list_empty( l ) )
63 return nl;
64 if ( !list_empty( nl ) )
65 {
66 int const l_size = list_length( l );
67 int const nl_size = list_length( nl );
68 int const size = l_size + nl_size;
69 unsigned const bucket = get_bucket( size );
70
71 /* Do we need to reallocate? */
72 if ( l_size <= ( 1u << ( bucket - 1 ) ) )
73 {
74 LIST * result = list_alloc( size );
75 memcpy( list_begin( result ), list_begin( l ), l_size * sizeof(
76 OBJECT * ) );
77 list_dealloc( l );
78 l = result;
79 }
80
81 l->impl.size = size;
82 memcpy( list_begin( l ) + l_size, list_begin( nl ), nl_size * sizeof(
83 OBJECT * ) );
84 list_dealloc( nl );
85 }
86 return l;
87}
88
89LISTITER list_begin( LIST * l )
90{

Callers 10

var_setFunction · 0.85
addsettingsFunction · 0.85
get_subkey_namesFunction · 0.85
get_value_namesFunction · 0.85
glob_recursiveFunction · 0.85
builtin_glob_recursiveFunction · 0.85
function_call_ruleFunction · 0.85
function_runFunction · 0.85
sequence_transformFunction · 0.85

Calls 5

list_lengthFunction · 0.85
get_bucketFunction · 0.85
list_allocFunction · 0.85
list_beginFunction · 0.85
list_deallocFunction · 0.85

Tested by

no test coverage detected