aboutsummaryrefslogtreecommitdiff
path: root/dep/jemalloc/src/rtree.c
diff options
context:
space:
mode:
authorclick <click@gonnamakeyou.com>2013-04-16 21:03:29 +0200
committerclick <click@gonnamakeyou.com>2013-04-16 21:03:29 +0200
commitacf6c79d9bd2fb41c00a39b745d29c100dd8b2c1 (patch)
treed1d66085950939b2aed3dcad1cfd1f42cd45c9a1 /dep/jemalloc/src/rtree.c
parente9d7b53e6dd74793b5ad81e7df7cd365adfe61e5 (diff)
Core/Dependencies: Upgrade to jemalloc-3.3.1 (Also fixes a few weird crashes), closes #7852
Note: This adds support for using jemalloc on FreeBSD, Mac OS X Lion and a few other platforms (not enabled by default) Please read dep/jemalloc/ChangeLog for further information (Changed from 2.1.1 and up apply)
Diffstat (limited to 'dep/jemalloc/src/rtree.c')
-rw-r--r--dep/jemalloc/src/rtree.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/dep/jemalloc/src/rtree.c b/dep/jemalloc/src/rtree.c
index 7753743c5e6..90c6935a0ed 100644
--- a/dep/jemalloc/src/rtree.c
+++ b/dep/jemalloc/src/rtree.c
@@ -1,4 +1,4 @@
-#define RTREE_C_
+#define JEMALLOC_RTREE_C_
#include "jemalloc/internal/jemalloc_internal.h"
rtree_t *
@@ -20,7 +20,10 @@ rtree_new(unsigned bits)
memset(ret, 0, offsetof(rtree_t, level2bits) + (sizeof(unsigned) *
height));
- malloc_mutex_init(&ret->mutex);
+ if (malloc_mutex_init(&ret->mutex)) {
+ /* Leak the rtree. */
+ return (NULL);
+ }
ret->height = height;
if (bits_per_level * height > bits)
ret->level2bits[0] = bits % bits_per_level;
@@ -41,3 +44,24 @@ rtree_new(unsigned bits)
return (ret);
}
+
+void
+rtree_prefork(rtree_t *rtree)
+{
+
+ malloc_mutex_prefork(&rtree->mutex);
+}
+
+void
+rtree_postfork_parent(rtree_t *rtree)
+{
+
+ malloc_mutex_postfork_parent(&rtree->mutex);
+}
+
+void
+rtree_postfork_child(rtree_t *rtree)
+{
+
+ malloc_mutex_postfork_child(&rtree->mutex);
+}