зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1118516 - Remove some dead code and bad abstraction; r=jonco
--HG-- extra : rebase_source : 4a181569fd44886296d1e2ce0916d0fdaea4174a
This commit is contained in:
Родитель
bbb500e982
Коммит
fd1dc599ab
|
@ -550,7 +550,6 @@ class GCRuntime
|
|||
ChunkPool expireEmptyChunkPool(bool shrinkBuffers, const AutoLockGC &lock);
|
||||
void freeEmptyChunks(JSRuntime *rt, const AutoLockGC &lock);
|
||||
void prepareToFreeChunk(ChunkInfo &info);
|
||||
void releaseChunk(Chunk *chunk);
|
||||
|
||||
friend class BackgroundAllocTask;
|
||||
friend class AutoMaybeStartBackgroundAllocation;
|
||||
|
|
|
@ -631,18 +631,6 @@ FinalizeArenas(FreeOp *fop,
|
|||
}
|
||||
}
|
||||
|
||||
static inline Chunk *
|
||||
AllocChunk(JSRuntime *rt)
|
||||
{
|
||||
return static_cast<Chunk *>(MapAlignedPages(ChunkSize, ChunkSize));
|
||||
}
|
||||
|
||||
static inline void
|
||||
FreeChunk(JSRuntime *rt, Chunk *p)
|
||||
{
|
||||
UnmapPages(static_cast<void *>(p), ChunkSize);
|
||||
}
|
||||
|
||||
Chunk *
|
||||
ChunkPool::pop()
|
||||
{
|
||||
|
@ -767,7 +755,7 @@ FreeChunkPool(JSRuntime *rt, ChunkPool &pool)
|
|||
iter.next();
|
||||
pool.remove(chunk);
|
||||
MOZ_ASSERT(!chunk->info.numArenasFreeCommitted);
|
||||
FreeChunk(rt, chunk);
|
||||
UnmapPages(static_cast<void *>(chunk), ChunkSize);
|
||||
}
|
||||
MOZ_ASSERT(pool.count() == 0);
|
||||
}
|
||||
|
@ -781,7 +769,7 @@ GCRuntime::freeEmptyChunks(JSRuntime *rt, const AutoLockGC &lock)
|
|||
/* static */ Chunk *
|
||||
Chunk::allocate(JSRuntime *rt)
|
||||
{
|
||||
Chunk *chunk = AllocChunk(rt);
|
||||
Chunk *chunk = static_cast<Chunk *>(MapAlignedPages(ChunkSize, ChunkSize));
|
||||
if (!chunk)
|
||||
return nullptr;
|
||||
chunk->init(rt);
|
||||
|
@ -789,15 +777,6 @@ Chunk::allocate(JSRuntime *rt)
|
|||
return chunk;
|
||||
}
|
||||
|
||||
/* Must be called with the GC lock taken. */
|
||||
void
|
||||
GCRuntime::releaseChunk(Chunk *chunk)
|
||||
{
|
||||
MOZ_ASSERT(chunk);
|
||||
prepareToFreeChunk(chunk->info);
|
||||
FreeChunk(rt, chunk);
|
||||
}
|
||||
|
||||
inline void
|
||||
GCRuntime::prepareToFreeChunk(ChunkInfo &info)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче