mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1360772 - Indicate to chunk_recycle callers that pages_commit has zeroed the chunk. r=njn
Before returning a chunk, chunk_recycle calls pages_commit (when MALLOC_DECOMMIT is enabled), which is guaranteed to zero the chunk. The code further zeroing the chunk afterwards, which is now moved out to chunk_alloc callers, never took advantage of that fact, duplicating the effort of zeroing the chunk on Windows. By indicating to the callers that the chunk has already been zeroed, we allow callers to skip zeroing on their own.
This commit is contained in:
parent
78a584db8a
commit
e6c1516607
@ -2060,6 +2060,10 @@ chunk_recycle(extent_tree_t *chunks_szad, extent_tree_t *chunks_ad, size_t size,
|
||||
base_node_dealloc(node);
|
||||
#ifdef MALLOC_DECOMMIT
|
||||
pages_commit(ret, size);
|
||||
// pages_commit is guaranteed to zero the chunk.
|
||||
if (zeroed) {
|
||||
*zeroed = true;
|
||||
}
|
||||
#endif
|
||||
return (ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user