| 34 | } |
| 35 | |
| 36 | int 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 | |
| 58 | int MempoolWrapper::thread_clear() { |
| 59 | MempoolRegion* mempool_region = |
no test coverage detected