mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Remove dead code. NFC.
This interface was added 2 years ago but users never developed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -88,7 +88,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
|
||||
if (NumBytes == 0)
|
||||
return MemoryBlock();
|
||||
|
||||
static const size_t PageSize = process::get_self()->page_size();
|
||||
static const size_t PageSize = Process::getPageSize();
|
||||
const size_t NumPages = (NumBytes+PageSize-1)/PageSize;
|
||||
|
||||
int fd = -1;
|
||||
@ -181,7 +181,7 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock,
|
||||
std::string *ErrMsg) {
|
||||
if (NumBytes == 0) return MemoryBlock();
|
||||
|
||||
size_t PageSize = process::get_self()->page_size();
|
||||
size_t PageSize = Process::getPageSize();
|
||||
size_t NumPages = (NumBytes+PageSize-1)/PageSize;
|
||||
|
||||
int fd = -1;
|
||||
|
@ -550,7 +550,7 @@ const char *mapped_file_region::const_data() const {
|
||||
}
|
||||
|
||||
int mapped_file_region::alignment() {
|
||||
return process::get_self()->page_size();
|
||||
return Process::getPageSize();
|
||||
}
|
||||
|
||||
std::error_code detail::directory_iterator_construct(detail::DirIterState &it,
|
||||
|
@ -57,10 +57,6 @@
|
||||
using namespace llvm;
|
||||
using namespace sys;
|
||||
|
||||
process::id_type self_process::get_id() {
|
||||
return getpid();
|
||||
}
|
||||
|
||||
static std::pair<TimeValue, TimeValue> getRUsageTimes() {
|
||||
#if defined(HAVE_GETRUSAGE)
|
||||
struct rusage RU;
|
||||
@ -80,43 +76,19 @@ static std::pair<TimeValue, TimeValue> getRUsageTimes() {
|
||||
#endif
|
||||
}
|
||||
|
||||
TimeValue self_process::get_user_time() const {
|
||||
#if _POSIX_TIMERS > 0 && _POSIX_CPUTIME > 0
|
||||
// Try to get a high resolution CPU timer.
|
||||
struct timespec TS;
|
||||
if (::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &TS) == 0)
|
||||
return TimeValue(static_cast<TimeValue::SecondsType>(TS.tv_sec),
|
||||
static_cast<TimeValue::NanoSecondsType>(TS.tv_nsec));
|
||||
#endif
|
||||
|
||||
// Otherwise fall back to rusage based timing.
|
||||
return getRUsageTimes().first;
|
||||
}
|
||||
|
||||
TimeValue self_process::get_system_time() const {
|
||||
// We can only collect system time by inspecting the results of getrusage.
|
||||
return getRUsageTimes().second;
|
||||
}
|
||||
|
||||
// On Cygwin, getpagesize() returns 64k(AllocationGranularity) and
|
||||
// offset in mmap(3) should be aligned to the AllocationGranularity.
|
||||
static unsigned getPageSize() {
|
||||
unsigned Process::getPageSize() {
|
||||
#if defined(HAVE_GETPAGESIZE)
|
||||
const int page_size = ::getpagesize();
|
||||
static const int page_size = ::getpagesize();
|
||||
#elif defined(HAVE_SYSCONF)
|
||||
long page_size = ::sysconf(_SC_PAGE_SIZE);
|
||||
static long page_size = ::sysconf(_SC_PAGE_SIZE);
|
||||
#else
|
||||
#warning Cannot get the page size on this machine
|
||||
#endif
|
||||
return static_cast<unsigned>(page_size);
|
||||
}
|
||||
|
||||
// This constructor guaranteed to be run exactly once on a single thread, and
|
||||
// sets up various process invariants that can be queried cheaply from then on.
|
||||
self_process::self_process() : PageSize(getPageSize()) {
|
||||
}
|
||||
|
||||
|
||||
size_t Process::GetMallocUsage() {
|
||||
#if defined(HAVE_MALLINFO)
|
||||
struct mallinfo mi;
|
||||
|
Reference in New Issue
Block a user