summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-04-17 00:40:16 (GMT)
committerJason Evans <jasone@canonware.com>2017-04-17 21:47:45 (GMT)
commit675701660cede59972707f60af32117023f91728 (patch)
tree89772d9223b6d47aea7c56cef5dcc187c04c5698 /src
parent3c9c41edb28b02c5ec45cfea0f076276e985cf9e (diff)
downloadjemalloc-675701660cede59972707f60af32117023f91728.zip
jemalloc-675701660cede59972707f60af32117023f91728.tar.gz
jemalloc-675701660cede59972707f60af32117023f91728.tar.bz2
Update base_unmap() to match extent_dalloc_wrapper().
Reverse the order of forced versus lazy purging attempts in base_unmap(), in order to match the order in extent_dalloc_wrapper(), which was reversed by 64e458f5cdd64f9b67cb495f177ef96bf3ce4e0e (Implement two-phase decay-based purging.).
Diffstat (limited to 'src')
-rw-r--r--src/base.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/base.c b/src/base.c
index eb68a17..00c6c6a 100644
--- a/src/base.c
+++ b/src/base.c
@@ -31,14 +31,14 @@ static void
base_unmap(extent_hooks_t *extent_hooks, unsigned ind, void *addr,
size_t size) {
/*
- * Cascade through dalloc, decommit, purge_lazy, and purge_forced,
+ * Cascade through dalloc, decommit, purge_forced, and purge_lazy,
* stopping at first success. This cascade is performed for consistency
* with the cascade in extent_dalloc_wrapper() because an application's
* custom hooks may not support e.g. dalloc. This function is only ever
* called as a side effect of arena destruction, so although it might
* seem pointless to do anything besides dalloc here, the application
- * may in fact want the end state of all associated virtual memory to in
- * some consistent-but-allocated state.
+ * may in fact want the end state of all associated virtual memory to be
+ * in some consistent-but-allocated state.
*/
if (extent_hooks == &extent_hooks_default) {
if (!extent_dalloc_mmap(addr, size)) {
@@ -47,10 +47,10 @@ base_unmap(extent_hooks_t *extent_hooks, unsigned ind, void *addr,
if (!pages_decommit(addr, size)) {
return;
}
- if (!pages_purge_lazy(addr, size)) {
+ if (!pages_purge_forced(addr, size)) {
return;
}
- if (!pages_purge_forced(addr, size)) {
+ if (!pages_purge_lazy(addr, size)) {
return;
}
/* Nothing worked. This should never happen. */
@@ -66,16 +66,16 @@ base_unmap(extent_hooks_t *extent_hooks, unsigned ind, void *addr,
ind)) {
return;
}
- if (extent_hooks->purge_lazy != NULL &&
- !extent_hooks->purge_lazy(extent_hooks, addr, size, 0, size,
- ind)) {
- return;
- }
if (extent_hooks->purge_forced != NULL &&
!extent_hooks->purge_forced(extent_hooks, addr, size, 0,
size, ind)) {
return;
}
+ if (extent_hooks->purge_lazy != NULL &&
+ !extent_hooks->purge_lazy(extent_hooks, addr, size, 0, size,
+ ind)) {
+ return;
+ }
/* Nothing worked. That's the application's problem. */
}
}