diff options
author | Björn Gustavsson <[email protected]> | 2019-08-22 13:40:54 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-22 13:40:54 +0200 |
commit | cabdfc991278d6322564ef7342e80b3dd3cdbc92 (patch) | |
tree | 1f8e3b6e13563ae43dd047fda505320a24cc057d /erts/emulator/test/hibernate_SUITE.erl | |
parent | d670fe64723ed348c8829a6528292cdc9d0ad5a1 (diff) | |
parent | 07a323813a47f92abf05bdf2255dc1354e82c55c (diff) | |
download | otp-cabdfc991278d6322564ef7342e80b3dd3cdbc92.tar.gz otp-cabdfc991278d6322564ef7342e80b3dd3cdbc92.tar.bz2 otp-cabdfc991278d6322564ef7342e80b3dd3cdbc92.zip |
Merge pull request #2351 from bjorng/bjorn/erts/optimize-cp-management/OTP-15077
Optimize continuation pointer management
Diffstat (limited to 'erts/emulator/test/hibernate_SUITE.erl')
-rw-r--r-- | erts/emulator/test/hibernate_SUITE.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index a20f306e04..d65d0ff2fd 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -46,12 +46,17 @@ all() -> basic(Config) when is_list(Config) -> Ref = make_ref(), Info = {self(),Ref}, - ExpectedHeapSz = erts_debug:size([Info]), + ExpectedHeapSz = expected_heap_size([Info]), Child = spawn_link(fun() -> basic_hibernator(Info) end), hibernate_wake_up(100, ExpectedHeapSz, Child), Child ! please_quit_now, ok. +expected_heap_size(Term) -> + %% When hibernating, an extra word will be allocated on the stack + %% for a continuation pointer. + erts_debug:size(Term) + 1. + hibernate_wake_up(0, _, _) -> ok; hibernate_wake_up(N, ExpectedHeapSz, Child) -> {heap_size,Before} = process_info(Child, heap_size), @@ -142,7 +147,7 @@ whats_up_calc(A1, A2, A3, A4, A5, A6, A7, A8, A9, Acc) -> dynamic_call(Config) when is_list(Config) -> Ref = make_ref(), Info = {self(),Ref}, - ExpectedHeapSz = erts_debug:size([Info]), + ExpectedHeapSz = expected_heap_size([Info]), Child = spawn_link(fun() -> ?MODULE:dynamic_call_hibernator(Info, hibernate) end), hibernate_wake_up(100, ExpectedHeapSz, Child), Child ! please_quit_now, |