summaryrefslogtreecommitdiffstats
path: root/test/integration/mallocx.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2015-09-25 03:07:17 (GMT)
committerJason Evans <jasone@canonware.com>2015-09-25 03:07:17 (GMT)
commite9192eacf8935e29fc62fddc2701f7942b1cc02c (patch)
treed20a95d9c02f1135e4352be0752372a8fc6073eb /test/integration/mallocx.c
parent486d249fb4715fd3de679b6c2a04f7e657883111 (diff)
parent02709688e09325026be402b63400f88e587293d7 (diff)
downloadjemalloc-4.0.3.zip
jemalloc-4.0.3.tar.gz
jemalloc-4.0.3.tar.bz2
Merge branch 'dev'4.0.3
Diffstat (limited to 'test/integration/mallocx.c')
-rw-r--r--test/integration/mallocx.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c
index 3973938..6253175 100644
--- a/test/integration/mallocx.c
+++ b/test/integration/mallocx.c
@@ -52,9 +52,20 @@ TEST_BEGIN(test_oom)
hugemax = get_huge_size(get_nhuge()-1);
- /* In practice hugemax is too large to be allocated. */
- assert_ptr_null(mallocx(hugemax, 0),
- "Expected OOM for mallocx(size=%#zx, 0)", hugemax);
+ /*
+ * It should be impossible to allocate two objects that each consume
+ * more than half the virtual address space.
+ */
+ {
+ void *p;
+
+ p = mallocx(hugemax, 0);
+ if (p != NULL) {
+ assert_ptr_null(mallocx(hugemax, 0),
+ "Expected OOM for mallocx(size=%#zx, 0)", hugemax);
+ dallocx(p, 0);
+ }
+ }
#if LG_SIZEOF_PTR == 3
size = ZU(0x8000000000000000);