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

Function list_push_back

v2/engine/lists.c:111–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 */
110
111LIST * list_push_back( LIST * head, OBJECT * value )
112{
113 unsigned int size = list_length( head );
114 unsigned int i;
115
116 if ( DEBUG_LISTS )
117 printf( "list > %s <\n", object_str( value ) );
118
119 /* If the size is a power of 2, reallocate. */
120 if ( size == 0 )
121 {
122 head = list_alloc( 1 );
123 }
124 else if ( ( ( size - 1 ) & size ) == 0 )
125 {
126 LIST * l = list_alloc( size + 1 );
127 memcpy( l, head, sizeof( LIST ) + size * sizeof( OBJECT * ) );
128 list_dealloc( head );
129 head = l;
130 }
131
132 list_begin( head )[ size ] = value;
133 head->impl.size = size + 1;
134
135 return head;
136}
137
138
139/*

Callers 15

file_remove_atexitFunction · 0.85
hcache_initFunction · 0.85
builtin_substFunction · 0.85
list_uniqueFunction · 0.85
list_from_pythonFunction · 0.85
call_timing_ruleFunction · 0.85
call_action_ruleFunction · 0.85
make1listFunction · 0.85
make1settingsFunction · 0.85
var_definesFunction · 0.85
add_module_nameFunction · 0.85
builtin_system_registryFunction · 0.85

Calls 5

list_lengthFunction · 0.85
object_strFunction · 0.85
list_allocFunction · 0.85
list_deallocFunction · 0.85
list_beginFunction · 0.85

Tested by

no test coverage detected