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

Function GC_malloc_atomic

v2/engine/boehm_gc/malloc.c:209–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207 void * GC_core_malloc_atomic(size_t lb)
208#else
209 void * GC_malloc_atomic(size_t lb)
210#endif
211{
212 void *op;
213 void ** opp;
214 size_t lg;
215 DCL_LOCK_STATE;
216
217 if(SMALL_OBJ(lb)) {
218 lg = GC_size_map[lb];
219 opp = &(GC_aobjfreelist[lg]);
220 LOCK();
221 if( EXPECT((op = *opp) == 0, 0) ) {
222 UNLOCK();
223 return(GENERAL_MALLOC((word)lb, PTRFREE));
224 }
225 *opp = obj_link(op);
226 GC_bytes_allocd += GRANULES_TO_BYTES(lg);
227 UNLOCK();
228 return((void *) op);
229 } else {
230 return(GENERAL_MALLOC((word)lb, PTRFREE));
231 }
232}
233
234/* provide a version of strdup() that uses the collector to allocate the
235 copy of the string */

Callers 10

GC_debug_malloc_atomicFunction · 0.70
GC_add_ext_descriptorFunction · 0.70
GC_make_array_descriptorFunction · 0.70
malloc.cFile · 0.70
GC_AllocProcFunction · 0.70
test.cFile · 0.50
mainFunction · 0.50
ptr_free_allocateMethod · 0.50
ptr_free_allocateMethod · 0.50

Calls

no outgoing calls

Tested by 1

mainFunction · 0.40