aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_vm.h
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2011-02-01 20:01:52 +0100
committerSverker Eriksson <sverker@erlang.org>2011-02-03 19:31:14 +0100
commit2e0181837dbe96a4ce738a339a9a02a6e26746f8 (patch)
tree41add3cbfdbb5fdfd9798dad9f33ad4a2592df8e /erts/emulator/beam/erl_vm.h
parent677d59fc6d76360dc5ad996bdf91a4c05293b52d (diff)
downloadotp-2e0181837dbe96a4ce738a339a9a02a6e26746f8.tar.gz
otp-2e0181837dbe96a4ce738a339a9a02a6e26746f8.tar.bz2
otp-2e0181837dbe96a4ce738a339a9a02a6e26746f8.zip
HALFWORD ETS match spec heap fragment optimization
Introduce HAllocX to allocate heap fragments with a larger capacity than requested and by that reduce the number of fragments allocated.
Diffstat (limited to 'erts/emulator/beam/erl_vm.h')
-rw-r--r--erts/emulator/beam/erl_vm.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h
index 48fa99934e..d6daf0cc4b 100644
--- a/erts/emulator/beam/erl_vm.h
+++ b/erts/emulator/beam/erl_vm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2011. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -120,14 +120,15 @@
* Allocate heap memory, first on the ordinary heap;
* failing that, in a heap fragment.
*/
-#define HAlloc(p, sz) \
+#define HAllocX(p, sz, xtra) \
(ASSERT_EXPR((sz) >= 0), \
ErtsHAllocLockCheck(p), \
(IS_FORCE_HEAP_FRAGS || (((HEAP_LIMIT(p) - HEAP_TOP(p)) < (sz))) \
- ? erts_heap_alloc((p),(sz)) \
+ ? erts_heap_alloc((p),(sz),(xtra)) \
: (INIT_HEAP_MEM(p,sz), \
HEAP_TOP(p) = HEAP_TOP(p) + (sz), HEAP_TOP(p) - (sz))))
+#define HAlloc(P, SZ) HAllocX(P,SZ,0)
#define HRelease(p, endp, ptr) \
if ((ptr) == (endp)) { \