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

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 13:38:29 PST 2019


lhames marked 2 inline comments as done.
lhames added inline comments.


================
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;
----------------
dblaikie wrote:
> Should this be 'const' too?
> 
> (similar for the other ones that have been made static)
Good catch. Thanks!


================
Comment at: lib/Support/Unix/Process.inc:78
 #else
 #error Cannot get the page size on this machine
 #endif
----------------
dblaikie wrote:
> 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.
It's definitely worth thinking about. I'm going to leave it for now, but I think you might be right that this is better off as a #warn and a runtime failure.


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