diff options
author | Sverker Eriksson <sverker@erlang.org> | 2013-06-03 14:02:16 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2013-06-03 14:26:53 +0200 |
commit | c86b42e40622f73bd75ca5599814648701444c6b (patch) | |
tree | f60bede26e58bf5792cef66c218c99e06c7ffd01 /erts | |
parent | 5ce6aba2ede9e06bb1daa250019454ea42dca657 (diff) | |
download | erlang-c86b42e40622f73bd75ca5599814648701444c6b.tar.gz |
erts: Rename allocator aoffcbf to aoffcaobf
and add documentation in erts_alloc
Diffstat (limited to 'erts')
-rw-r--r-- | erts/doc/src/erts_alloc.xml | 12 | ||||
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 2 | ||||
-rw-r--r-- | erts/emulator/test/alloc_SUITE_data/coalesce.c | 2 | ||||
-rw-r--r-- | erts/emulator/test/alloc_SUITE_data/rbtree.c | 18 |
4 files changed, 22 insertions, 12 deletions
diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index a95b5d7cc4..f79241d692 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -170,6 +170,15 @@ used. The time complexity is proportional to log N, where N is the number of free blocks.</p> </item> + <tag>Address order first fit carrier address order best fit</tag> + <item> + <p>Strategy: Find the <em>carrier</em> with the lowest address that + can satisfy the requested block size, then find a block within + that carrier using the "adress order best fit" strategy.</p> + <p>Implementation: Balanced binary search trees are + used. The time complexity is proportional to log N, where + N is the number of free blocks.</p> + </item> <tag>Good fit</tag> <item> <p>Strategy: Try to find the best fit, but settle for the best fit @@ -300,10 +309,11 @@ subsystem identifier, only the specific allocator identified will be effected:</p> <taglist> - <tag><marker id="M_as"><c><![CDATA[+M<S>as bf|aobf|aoff|gf|af]]></c></marker></tag> + <tag><marker id="M_as"><c><![CDATA[+M<S>as bf|aobf|aoff|aoffcaobf|gf|af]]></c></marker></tag> <item> Allocation strategy. Valid strategies are <c>bf</c> (best fit), <c>aobf</c> (address order best fit), <c>aoff</c> (address order first fit), + <c>aoffcaobf</c> (address order first fit carrier address order best fit), <c>gf</c> (good fit), and <c>af</c> (a fit). See <seealso marker="#strategy">the description of allocation strategies</seealso> in "the <c>alloc_util</c> framework" section.</item> <tag><marker id="M_asbcst"><c><![CDATA[+M<S>asbcst <size>]]></c></marker></tag> diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index d45cd48623..4bb7bae870 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1140,7 +1140,7 @@ handle_au_arg(struct au_init *auip, auip->atype = AOFIRSTFIT; auip->init.aoff.bf_within_carrier = 0; } - else if (strcmp("aoffcbf", alg) == 0) { + else if (strcmp("aoffcaobf", alg) == 0) { auip->atype = AOFIRSTFIT; auip->init.aoff.bf_within_carrier = 1; } diff --git a/erts/emulator/test/alloc_SUITE_data/coalesce.c b/erts/emulator/test/alloc_SUITE_data/coalesce.c index 1fb4d7791d..36710bf7b5 100644 --- a/erts/emulator/test/alloc_SUITE_data/coalesce.c +++ b/erts/emulator/test/alloc_SUITE_data/coalesce.c @@ -267,7 +267,7 @@ void testcase_run(TestCaseState_t *tcs) { char *argv_org[] = {"-tsmbcs511","-tmmbcs511", "-tsbct512", "-trmbcmt100", "-tas", NULL, NULL}; - char *alg[] = {"af", "gf", "bf", "aobf", "aoff", "aoffcbf", NULL}; + char *alg[] = {"af", "gf", "bf", "aobf", "aoff", "aoffcaobf", NULL}; int i; for (i = 0; alg[i]; i++) { diff --git a/erts/emulator/test/alloc_SUITE_data/rbtree.c b/erts/emulator/test/alloc_SUITE_data/rbtree.c index cb4e387056..ef7a9ef01e 100644 --- a/erts/emulator/test/alloc_SUITE_data/rbtree.c +++ b/erts/emulator/test/alloc_SUITE_data/rbtree.c @@ -85,7 +85,7 @@ print_tree(TestCaseState_t *tcs, RBT_t *root) static RBT_t * check_tree(TestCaseState_t *tcs, Allctr_t *alc, Ulong size) { - enum { BF, AOBF, AOFF, AOFFCBF }type; + enum { BF, AOBF, AOFF, AOFFCAOBF }type; int i, max_i; char stk[128]; RBT_t *root, *x, *y, *res; @@ -99,7 +99,7 @@ check_tree(TestCaseState_t *tcs, Allctr_t *alc, Ulong size) else type = BF; } else { /* AOFF_ALGO */ - if (IS_CBF(alc)) type = AOFFCBF; + if (IS_CBF(alc)) type = AOFFCAOBF; else type = AOFF; } @@ -193,7 +193,7 @@ check_tree(TestCaseState_t *tcs, Allctr_t *alc, Ulong size) ASSERT(tcs, y < x); ASSERT(tcs, RBT_MAX_SZ(y) <= RBT_MAX_SZ(x)); break; - case AOFFCBF: + case AOFFCAOBF: { void* x_crr = BLK_TO_MBC(x); void* y_crr = BLK_TO_MBC(y); @@ -221,7 +221,7 @@ check_tree(TestCaseState_t *tcs, Allctr_t *alc, Ulong size) ASSERT(tcs, y > x); ASSERT(tcs, RBT_MAX_SZ(y) <= RBT_MAX_SZ(x)); break; - case AOFFCBF: + case AOFFCAOBF: { void* x_crr = BLK_TO_MBC(x); void* y_crr = BLK_TO_MBC(y); @@ -262,7 +262,7 @@ check_tree(TestCaseState_t *tcs, Allctr_t *alc, Ulong size) res = x; } break; - case AOFFCBF: + case AOFFCAOBF: if (BLK_TO_MBC(x) != BLK_TO_MBC(res) || x_sz == y_sz) { if (x < res) { res = x; @@ -484,7 +484,7 @@ testcase_run(TestCaseState_t *tcs) char *argv1[] = {"-tasbf", NULL}; char *argv2[] = {"-tasaobf", NULL}; char *argv3[] = {"-tasaoff", NULL}; - char *argv4[] = {"-tasaoffcbf", NULL}; + char *argv4[] = {"-tasaoffcaobf", NULL}; Allctr_t *a; rbtree_test_data *td; @@ -555,10 +555,10 @@ testcase_run(TestCaseState_t *tcs) /* Address order first fit, best fit within carrier */ - testcase_printf(tcs, "Starting test of aoffcbf...\n"); + testcase_printf(tcs, "Starting test of aoffcaobf...\n"); current_rbt_type_op_base = AO_FIRSTFIT_OP_BASE; - td->allocator = a = START_ALC("rbtree_aoffcbf_", 0, argv4); + td->allocator = a = START_ALC("rbtree_aoffcaobf_", 0, argv4); ASSERT(tcs, a); ASSERT(tcs, !IS_BF_ALGO(a)); @@ -570,6 +570,6 @@ testcase_run(TestCaseState_t *tcs) STOP_ALC(a); td->allocator = NULL; - testcase_printf(tcs, "aoffcbf test succeeded!\n"); + testcase_printf(tcs, "aoffcaobf test succeeded!\n"); } |