diff options
author | Sverker Eriksson <[email protected]> | 2018-05-22 14:43:30 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-05-22 14:43:30 +0200 |
commit | 9cf67430bff860d47c359df6b997c8bcd0985f4c (patch) | |
tree | 45dc24bf4d20077336e330ccc5a2e9ec4ae65b91 /erts/emulator/beam/erl_alloc_util.h | |
parent | 48f2d66707330667c6d3e268466b5440d1b930ab (diff) | |
download | otp-9cf67430bff860d47c359df6b997c8bcd0985f4c.tar.gz otp-9cf67430bff860d47c359df6b997c8bcd0985f4c.tar.bz2 otp-9cf67430bff860d47c359df6b997c8bcd0985f4c.zip |
erts: Let allocator pooled_tree also use Age Order
if configured for the allocator. This was not implemented
and pooled_tree always used address order first fit.
The "problem" was as a carrier can be part of both the pooled tree
(of its owner) and the allocation tree (of a foreign instance)
at the same time. Solved by duplicating 'birth_time' in both
AOFF_RBTree_t nodes for each carrier.
Blocks still cannot use age order and does not pay
any memory cost for birth_time.
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.h')
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h index ff4d10b206..cbae8ce98a 100644 --- a/erts/emulator/beam/erl_alloc_util.h +++ b/erts/emulator/beam/erl_alloc_util.h @@ -414,6 +414,10 @@ struct AOFF_RBTree_t_ { AOFF_RBTree_t *right; Uint32 flags; Uint32 max_sz; /* of all blocks in this sub-tree */ + union { + AOFF_RBTree_t* next; /* for best fit */ + Sint64 birth_time; /* for age first fit */ + } u; }; void aoff_add_pooled_mbc(Allctr_t*, Carrier_t*); |