MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / thread_initialize

Method thread_initialize

core/predictor/framework/memory.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36int MempoolWrapper::thread_initialize() {
37 im::fugue::memory::Region* region = new im::fugue::memory::Region();
38 region->init();
39 im::Mempool* mempool = new (std::nothrow) im::Mempool(region);
40 if (mempool == NULL) {
41 LOG(ERROR) << "Failed create thread mempool";
42 return -1;
43 }
44 MempoolRegion* mempool_region = new MempoolRegion(region, mempool);
45
46 if (THREAD_SETSPECIFIC(_bspec_key, mempool_region) != 0) {
47 LOG(ERROR) << "unable to set the thrd_data";
48 delete region;
49 delete mempool;
50 delete mempool_region;
51 return -1;
52 }
53
54 LOG(WARNING) << "Succ thread initialize mempool wrapper";
55 return 0;
56}
57
58int MempoolWrapper::thread_clear() {
59 MempoolRegion* mempool_region =

Callers 3

call_backFunction · 0.45
workMethod · 0.45
pthread_worker_start_fnFunction · 0.45

Calls 1

initMethod · 0.45

Tested by

no test coverage detected