diff options
author | Sverker Eriksson <[email protected]> | 2011-02-01 20:01:52 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-02-03 19:31:14 +0100 |
commit | 2e0181837dbe96a4ce738a339a9a02a6e26746f8 (patch) | |
tree | 41add3cbfdbb5fdfd9798dad9f33ad4a2592df8e /erts/emulator/beam/utils.c | |
parent | 677d59fc6d76360dc5ad996bdf91a4c05293b52d (diff) | |
download | otp-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/utils.c')
-rw-r--r-- | erts/emulator/beam/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 2d0155bdf5..f531d1430b 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -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 @@ -91,7 +91,7 @@ dispatch_profile_msg_q(profile_sched_msg_q *psmq) Eterm* -erts_heap_alloc(Process* p, Uint need) +erts_heap_alloc(Process* p, Uint need, Uint xtra) { ErlHeapFragment* bp; Eterm* htop; @@ -117,7 +117,7 @@ erts_heap_alloc(Process* p, Uint need) p->space_verified_from = NULL; #endif /* FORCE_HEAP_FRAGS */ - n = need; + n = need + xtra; bp = MBUF(p); if (bp != NULL && need <= (bp->alloc_size - bp->used_size)) { Eterm* ret = bp->mem + bp->used_size; @@ -153,7 +153,7 @@ erts_heap_alloc(Process* p, Uint need) bp->next = MBUF(p); MBUF(p) = bp; bp->alloc_size = n; - bp->used_size = n; + bp->used_size = need; MBUF_SIZE(p) += n; bp->off_heap.first = NULL; bp->off_heap.overhead = 0; |