MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / do_stack_pages_gc

Function do_stack_pages_gc

thread/thread.cpp:1480–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478 }
1479
1480 static void do_stack_pages_gc(void* arg) {
1481#if !defined(_WIN64) && !defined(__aarch64__)
1482 auto th = (thread*)arg;
1483 assert(th->vcpu == CURRENT->vcpu);
1484 auto buf = th->buf;
1485 if (buf == nullptr) {
1486 // th is the main thread of the vcpu
1487 return;
1488 }
1489 auto rsp = (char*)th->stack._ptr;
1490 auto len = align_down(rsp - buf, PAGE_SIZE);
1491 madvise(buf, len, MADV_DONTNEED);
1492#endif
1493 }
1494
1495 int stack_pages_gc(thread* th) {
1496 if (!th || th->vcpu != CURRENT->vcpu)

Callers 1

stack_pages_gcFunction · 0.85

Calls 1

align_downFunction · 0.50

Tested by

no test coverage detected