MCPcopy Create free account
hub / github.com/catboost/catboost / ReleaseRss

Function ReleaseRss

library/cpp/coroutine/engine/stack/stack_utils.cpp:37–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 }

Callers 3

ReleaseMemoryMethod · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected