[PATCH] D59107: [Support] Add error handling to sys::Process::getPageSize().

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 13:23:54 PST 2019


dblaikie added a comment.

Seems reasonable to me (but feel free to wait for someone with more context/domain awareness)



================
Comment at: lib/ExecutionEngine/Orc/OrcABISupport.cpp:932
   // Emit at least MinStubs, rounded up to fill the pages allocated.
-  unsigned PageSize = sys::Process::getPageSize();
+  static unsigned PageSize = sys::Process::getPageSizeEstimate();
   unsigned NumPages = ((MinStubs * StubSize) + (PageSize - 1)) / PageSize;
----------------
Should this be 'const' too?

(similar for the other ones that have been made static)


================
Comment at: lib/Support/Unix/Process.inc:78
 #else
 #error Cannot get the page size on this machine
 #endif
----------------
I suppose in theory we could turn this from compile-time to runtime failure & then systems that don't provide these ways to access the page size would be OK except for running stuff that /needs/ it like the JIT.

But I doubt that's important/worth doing.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59107/new/

https://reviews.llvm.org/D59107





More information about the llvm-commits mailing list