mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
CodeAlloc changes to eliminate dependency on 4K system page size (bug 545295 r=edwsmith+)
--HG-- extra : convert_revision : f1734da5dae9a73cf52692fc8dd72c25d0f12a14
This commit is contained in:
parent
e802b90f31
commit
8e9b1ee383
@ -54,14 +54,15 @@ namespace nanojit
|
||||
#else
|
||||
static const int pagesPerAlloc = 16;
|
||||
#endif
|
||||
static const int bytesPerPage = 4096;
|
||||
static const int bytesPerAlloc = pagesPerAlloc * bytesPerPage;
|
||||
|
||||
CodeAlloc::CodeAlloc()
|
||||
: heapblocks(0)
|
||||
, availblocks(0)
|
||||
, totalAllocated(0)
|
||||
{}
|
||||
, bytesPerPage(VMPI_getVMPageSize())
|
||||
, bytesPerAlloc(pagesPerAlloc * bytesPerPage)
|
||||
{
|
||||
}
|
||||
|
||||
CodeAlloc::~CodeAlloc() {
|
||||
reset();
|
||||
|
@ -121,6 +121,12 @@ namespace nanojit
|
||||
CodeList* availblocks;
|
||||
size_t totalAllocated;
|
||||
|
||||
/** Cached value of VMPI_getVMPageSize */
|
||||
const size_t bytesPerPage;
|
||||
|
||||
/** Number of bytes to request from VMPI layer, always a multiple of the page size */
|
||||
const size_t bytesPerAlloc;
|
||||
|
||||
/** remove one block from a list */
|
||||
static CodeList* removeBlock(CodeList* &list);
|
||||
|
||||
@ -137,7 +143,7 @@ namespace nanojit
|
||||
void sanity_check();
|
||||
|
||||
/** find the beginning of the heapblock terminated by term */
|
||||
static CodeList* firstBlock(CodeList* term);
|
||||
CodeList* firstBlock(CodeList* term);
|
||||
|
||||
//
|
||||
// CodeAlloc's SPI. Implementations must be defined by nanojit embedder.
|
||||
|
Loading…
Reference in New Issue
Block a user