| 58 | public: |
| 59 | CustomAllocWorker(Function& cb) : AsyncWorker(cb){}; |
| 60 | static void DoWork(const CallbackInfo& info) { |
| 61 | Function cb = info[0].As<Function>(); |
| 62 | Allocator allocator; |
| 63 | CustomAllocWorker* newWorker = allocator.allocate(1); |
| 64 | std::allocator_traits<Allocator>::construct(allocator, newWorker, cb); |
| 65 | newWorker->Queue(); |
| 66 | } |
| 67 | |
| 68 | protected: |
| 69 | void Execute() override {} |