summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-06-04 17:58:34 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-06-04 17:58:48 (GMT)
commit1f2b71e31326a5bc021785888cd2203010acf4e6 (patch)
treeb82fd64f1137a09553aa2cb513f974e1308e3022 /plugins
parenta7f73441a0d466824798a421f369628db0184030 (diff)
Defined the number of threads to run from a centralized function.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dex/pool.c7
-rw-r--r--plugins/elf/symbols.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/dex/pool.c b/plugins/dex/pool.c
index 1ed2c44..081c178 100644
--- a/plugins/dex/pool.c
+++ b/plugins/dex/pool.c
@@ -30,6 +30,7 @@
#include <i18n.h>
#include <core/global.h>
+#include <core/nproc.h>
#include <mangling/demangler.h>
@@ -201,7 +202,7 @@ bool load_all_dex_types(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *sta
/* Lancement des chargements */
- runs_count = g_get_num_processors();
+ runs_count = get_max_online_threads();
run_size = count / runs_count;
@@ -362,7 +363,7 @@ bool load_all_dex_fields(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *st
/* Lancement des chargements */
- runs_count = g_get_num_processors();
+ runs_count = get_max_online_threads();
run_size = count / runs_count;
@@ -731,7 +732,7 @@ bool load_all_dex_classes(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *s
/* Lancement des chargements */
- runs_count = g_get_num_processors();
+ runs_count = get_max_online_threads();
run_size = format->header.class_defs_size / runs_count;
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c
index 1b47616..949e495 100644
--- a/plugins/elf/symbols.c
+++ b/plugins/elf/symbols.c
@@ -36,6 +36,7 @@
#include <common/sort.h>
#include <core/global.h>
#include <core/logs.h>
+#include <core/nproc.h>
#include <format/symiter.h>
#include <mangling/demangler.h>
@@ -597,7 +598,7 @@ static void add_all_elf_symbols(GElfFormat *format, phys_t sym_start, size_t cou
sym_size = ELF_SIZEOF_SYM(format);
- runs_count = g_get_num_processors();
+ runs_count = get_max_online_threads();
run_size = count / runs_count;
@@ -1013,7 +1014,7 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
queue = get_work_queue();
- runs_count = g_get_num_processors();
+ runs_count = get_max_online_threads();
run_size = length / runs_count;