| 35 | |
| 36 | #ifdef _linux_ |
| 37 | void ReleaseRss(char* alignedPtr, size_t numOfPages) noexcept { |
| 38 | Y_ABORT_UNLESS( !((size_t)alignedPtr & PageSizeMask), "Not aligned pointer to release RSS memory"); |
| 39 | if (!numOfPages) { |
| 40 | return; |
| 41 | } |
| 42 | if (auto res = madvise((void*) alignedPtr, numOfPages * PageSize, MADV_DONTNEED); res) { |
| 43 | Y_ABORT_UNLESS(errno == EAGAIN || errno == ENOMEM, "Failed to release memory"); |
| 44 | } |
| 45 | } |
| 46 | #else |
| 47 | void ReleaseRss(char*, size_t) noexcept { |
| 48 | } |
no outgoing calls
no test coverage detected