mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #187: Remove solaris conditional code.
This commit is contained in:
parent
471c65b924
commit
78d61fd2b1
26 changed files with 12 additions and 448 deletions
|
|
@ -17,11 +17,6 @@
|
|||
#include "jswin.h"
|
||||
#include <psapi.h>
|
||||
|
||||
#elif defined(SOLARIS)
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
|
||||
#include <algorithm>
|
||||
|
|
@ -408,86 +403,6 @@ DeallocateMappedContent(void* p, size_t length)
|
|||
|
||||
# endif
|
||||
|
||||
#elif defined(SOLARIS)
|
||||
|
||||
#ifndef MAP_NOSYNC
|
||||
# define MAP_NOSYNC 0
|
||||
#endif
|
||||
|
||||
void
|
||||
InitMemorySubsystem()
|
||||
{
|
||||
if (pageSize == 0)
|
||||
pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
|
||||
}
|
||||
|
||||
void*
|
||||
MapAlignedPages(size_t size, size_t alignment)
|
||||
{
|
||||
MOZ_ASSERT(size >= alignment);
|
||||
MOZ_ASSERT(size >= allocGranularity);
|
||||
MOZ_ASSERT(size % alignment == 0);
|
||||
MOZ_ASSERT(size % pageSize == 0);
|
||||
MOZ_ASSERT_IF(alignment < allocGranularity, allocGranularity % alignment == 0);
|
||||
MOZ_ASSERT_IF(alignment > allocGranularity, alignment % allocGranularity == 0);
|
||||
|
||||
int prot = PROT_READ | PROT_WRITE;
|
||||
int flags = MAP_PRIVATE | MAP_ANON | MAP_ALIGN | MAP_NOSYNC;
|
||||
|
||||
void* p = mmap((caddr_t)alignment, size, prot, flags, -1, 0);
|
||||
if (p == MAP_FAILED)
|
||||
return nullptr;
|
||||
return p;
|
||||
}
|
||||
|
||||
static void*
|
||||
MapAlignedPagesLastDitch(size_t size, size_t alignment)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
UnmapPages(void* p, size_t size)
|
||||
{
|
||||
MOZ_ALWAYS_TRUE(0 == munmap((caddr_t)p, size));
|
||||
}
|
||||
|
||||
bool
|
||||
MarkPagesUnused(void* p, size_t size)
|
||||
{
|
||||
MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
MarkPagesInUse(void* p, size_t size)
|
||||
{
|
||||
if (!DecommitEnabled())
|
||||
return;
|
||||
|
||||
MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
|
||||
}
|
||||
|
||||
size_t
|
||||
GetPageFaultCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void*
|
||||
AllocateMappedContent(int fd, size_t offset, size_t length, size_t alignment)
|
||||
{
|
||||
// Not implemented.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Deallocate mapped memory for object.
|
||||
void
|
||||
DeallocateMappedContent(void* p, size_t length)
|
||||
{
|
||||
// Not implemented.
|
||||
}
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue