summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dex/pool.c20
-rw-r--r--plugins/dwarf/info.c4
-rw-r--r--plugins/elf/strings.c4
-rw-r--r--plugins/elf/symbols.c8
-rw-r--r--plugins/lnxsyscalls/core.c4
5 files changed, 10 insertions, 30 deletions
diff --git a/plugins/dex/pool.c b/plugins/dex/pool.c
index d95f519..fb710f3 100644
--- a/plugins/dex/pool.c
+++ b/plugins/dex/pool.c
@@ -77,9 +77,7 @@ bool load_all_dex_string_symbols(GDexFormat *format, wgroup_id_t gid, GtkStatusS
/* Lancement des chargements */
- runs_count = get_max_online_threads();
-
- run_size = count / runs_count;
+ run_size = compute_run_size(count, &runs_count);
queue = get_work_queue();
@@ -288,9 +286,7 @@ bool load_all_dex_types(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *sta
/* Lancement des chargements */
- runs_count = get_max_online_threads();
-
- run_size = count / runs_count;
+ run_size = compute_run_size(count, &runs_count);
queue = get_work_queue();
@@ -447,9 +443,7 @@ bool load_all_dex_fields(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *st
/* Lancement des chargements */
- runs_count = get_max_online_threads();
-
- run_size = count / runs_count;
+ run_size = compute_run_size(count, &runs_count);
queue = get_work_queue();
@@ -758,9 +752,7 @@ bool load_all_dex_methods(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *s
/* Lancement des chargements */
- runs_count = get_max_online_threads();
-
- run_size = format->header.method_ids_size / runs_count;
+ run_size = compute_run_size(format->header.method_ids_size, &runs_count);
queue = get_work_queue();
@@ -898,9 +890,7 @@ bool load_all_dex_classes(GDexFormat *format, wgroup_id_t gid, GtkStatusStack *s
/* Lancement des chargements */
- runs_count = get_max_online_threads();
-
- run_size = format->header.class_defs_size / runs_count;
+ run_size = compute_run_size(format->header.class_defs_size, &runs_count);
queue = get_work_queue();
diff --git a/plugins/dwarf/info.c b/plugins/dwarf/info.c
index 7a2be44..b0d853c 100644
--- a/plugins/dwarf/info.c
+++ b/plugins/dwarf/info.c
@@ -149,9 +149,7 @@ bool load_dwarf_debug_information(GDwarfFormat *format, wgroup_id_t gid, GtkStat
/* Lancement des travaux */
- runs_count = get_max_online_threads();
-
- run_size = count / runs_count;
+ run_size = compute_run_size(count, &runs_count);
queue = get_work_queue();
diff --git a/plugins/elf/strings.c b/plugins/elf/strings.c
index 7dd644e..f6be4a8 100644
--- a/plugins/elf/strings.c
+++ b/plugins/elf/strings.c
@@ -206,9 +206,7 @@ static bool parse_elf_string_data(GElfFormat *format, phys_t start, phys_t size,
{
final = start + size;
- runs_count = get_max_online_threads();
-
- run_size = size / runs_count;
+ run_size = compute_run_size(size, &runs_count);
gtk_status_stack_extend_activity(status, msg, size);
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c
index 08d9377..b6f05f6 100644
--- a/plugins/elf/symbols.c
+++ b/plugins/elf/symbols.c
@@ -601,9 +601,7 @@ static void add_all_elf_symbols(GElfFormat *format, phys_t sym_start, size_t cou
sym_size = ELF_SIZEOF_SYM(format);
- runs_count = get_max_online_threads();
-
- run_size = count / runs_count;
+ run_size = compute_run_size(count, &runs_count);
gtk_status_stack_extend_activity(status, msg, count);
@@ -1017,9 +1015,7 @@ static bool load_elf_relocations(GElfFormat *format, const elf_phdr *dynamic, el
queue = get_work_queue();
- runs_count = get_max_online_threads();
-
- run_size = length / runs_count;
+ run_size = compute_run_size(length, &runs_count);
loadings = (GElfLoading **)malloc(runs_count * sizeof(GElfLoading *));
diff --git a/plugins/lnxsyscalls/core.c b/plugins/lnxsyscalls/core.c
index cd9fa0e..afc890b 100644
--- a/plugins/lnxsyscalls/core.c
+++ b/plugins/lnxsyscalls/core.c
@@ -128,9 +128,7 @@ G_MODULE_EXPORT void process_binary_disassembly(const GPluginModule *plugin, Plu
sym_count = g_binary_format_count_symbols(format);
- runs_count = get_max_online_threads();
-
- run_size = sym_count / runs_count;
+ run_size = compute_run_size(sym_count, &runs_count);
id = gtk_status_stack_add_activity(status, _("Looking for Linux syscalls..."), sym_count);