| 415 | } |
| 416 | |
| 417 | void free(void* memory) noexcept override |
| 418 | { |
| 419 | try |
| 420 | { |
| 421 | py::gil_scoped_acquire gil{}; |
| 422 | py::function pyFree = utils::getOverride(static_cast<IGpuAllocator*>(this), "free"); |
| 423 | if (!pyFree) |
| 424 | { |
| 425 | return; |
| 426 | } |
| 427 | |
| 428 | pyFree(reinterpret_cast<size_t>(memory)); |
| 429 | } |
| 430 | catch (std::exception const& e) |
| 431 | { |
| 432 | std::cerr << "[ERROR] Exception caught in free(): " << e.what() << std::endl; |
| 433 | } |
| 434 | catch (...) |
| 435 | { |
| 436 | std::cerr << "[ERROR] Exception caught in free()" << std::endl; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | bool deallocate(void* memory) noexcept override |
| 441 | { |
nothing calls this directly
no test coverage detected