aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/dirty_nif_SUITE_data
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-05-02 15:57:50 +0200
committerRickard Green <[email protected]>2016-05-11 16:35:50 +0200
commit4aea719054a594a06aceb34afca0ea3df65ead77 (patch)
tree605ad2fcab79d504d74fcbd95c61e98464055982 /erts/emulator/test/dirty_nif_SUITE_data
parent4d3c48a050e2d28a41b75c3b02b48520659e52e6 (diff)
downloadotp-4aea719054a594a06aceb34afca0ea3df65ead77.tar.gz
otp-4aea719054a594a06aceb34afca0ea3df65ead77.tar.bz2
otp-4aea719054a594a06aceb34afca0ea3df65ead77.zip
Add dirty_heap_access test case
Diffstat (limited to 'erts/emulator/test/dirty_nif_SUITE_data')
-rw-r--r--erts/emulator/test/dirty_nif_SUITE_data/dirty_nif_SUITE.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/erts/emulator/test/dirty_nif_SUITE_data/dirty_nif_SUITE.c b/erts/emulator/test/dirty_nif_SUITE_data/dirty_nif_SUITE.c
index 8de60d1020..2013c88167 100644
--- a/erts/emulator/test/dirty_nif_SUITE_data/dirty_nif_SUITE.c
+++ b/erts/emulator/test/dirty_nif_SUITE_data/dirty_nif_SUITE.c
@@ -45,7 +45,6 @@ static ERL_NIF_TERM dirty_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[
int n;
char s[10];
ErlNifBinary b;
- ERL_NIF_TERM result;
if (have_dirty_schedulers()) {
assert(enif_is_on_dirty_scheduler(env));
}
@@ -197,6 +196,18 @@ static ERL_NIF_TERM dirty_call_while_terminated_nif(ErlNifEnv* env, int argc, co
return enif_make_atom(env, "ok");
}
+static ERL_NIF_TERM dirty_heap_access_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ERL_NIF_TERM res = enif_make_list(env, 0);
+ int i;
+ assert(enif_is_on_dirty_scheduler(env));
+ for (i = 0; i < 1000; i++)
+ res = enif_make_list_cell(env, enif_make_copy(env, argv[0]), res);
+
+ return res;
+}
+
+
static ErlNifFunc nif_funcs[] =
{
{"lib_loaded", 0, lib_loaded},
@@ -205,7 +216,8 @@ static ErlNifFunc nif_funcs[] =
{"call_dirty_nif_exception", 1, call_dirty_nif_exception, ERL_NIF_DIRTY_JOB_IO_BOUND},
{"call_dirty_nif_zero_args", 0, call_dirty_nif_zero_args, ERL_NIF_DIRTY_JOB_CPU_BOUND},
{"dirty_sleeper", 0, dirty_sleeper, ERL_NIF_DIRTY_JOB_IO_BOUND},
- {"dirty_call_while_terminated_nif", 1, dirty_call_while_terminated_nif, ERL_NIF_DIRTY_JOB_CPU_BOUND}
+ {"dirty_call_while_terminated_nif", 1, dirty_call_while_terminated_nif, ERL_NIF_DIRTY_JOB_CPU_BOUND},
+ {"dirty_heap_access_nif", 1, dirty_heap_access_nif, ERL_NIF_DIRTY_JOB_CPU_BOUND}
};
ERL_NIF_INIT(dirty_nif_SUITE,nif_funcs,load,NULL,NULL,NULL)