MCPcopy Create free account
hub / github.com/RaftLib/RaftLib / run

Method run

src/stdalloc.cpp:40–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void
41stdalloc::run()
42{
43 auto alloc_func = [&]( PortInfo &a,
44 PortInfo &b,
45 void *data )
46 {
47 (void) data;
48
49 assert( a.type == b.type );
50 /** assume everyone needs a heap for the moment to get working **/
51 auto &func_map( a.const_map[ Type::Heap ] );
52 FIFO *fifo( nullptr );
53 auto test_func( (*func_map)[ false ] );
54 /** check and see if a has a defined allocation **/
55 if( a.existing_buffer != nullptr )
56 {
57 fifo = test_func( a.nitems,
58 a.start_index,
59 a.existing_buffer );
60 }
61 else
62 {
63 /** check for pre-existing alloc size for test purposes **/
64 fifo = test_func( a.fixed_buffer_size != 0 ?
65 a.fixed_buffer_size : 4 /** size **/,
66 ALLOC_ALIGN_WIDTH /** align **/,
67 nullptr /** data struct **/);
68 }
69 assert( fifo != nullptr );
70 (this)->initialize( &a, &b, fifo );
71 };
72 auto &container( (this)->source_kernels.acquire() );
73 GraphTools::BFS( container, alloc_func );
74 (this)->source_kernels.release();
75 (this)->setReady();
76 return;
77}

Callers 2

kernelRunMethod · 0.45
mem_thread( [&]Function · 0.45

Calls 2

initializeMethod · 0.80
setReadyMethod · 0.80

Tested by

no test coverage detected