public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Only apply die limits in regular mode
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

In off_htab_add_die we have:
...
      if (low_mem
         || op_multifile
         || estimated_nr_dies >= low_mem_die_limit
         || estimated_nr_dies >= max_die_limit)
       initial_size = default_initial_size;
...

Die limits are only supposed to apply in regular mode, but the formulation
allows the limits to apply in read_multifile and finalize_multifile mode as
well.

I don't think this can trigger a difference in behaviour in finalize_multifile
mode, but it might in read_multifile mode.

Fix this by only testing die limits in regular mode.

Committed to trunk.

Thanks,
- Tom

Only apply die limits in regular mode

2019-11-25  Tom de Vries  <tdevries@suse.de>

	* dwz.c (off_htab_add_die): Only test die limits in regular mode.

---
 dwz.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dwz.c b/dwz.c
index c8e43b7..5aab860 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1284,8 +1284,9 @@ off_htab_add_die (dw_cu_ref cu, dw_die_ref die)
       size_t initial_size;
       if (low_mem
 	  || op_multifile
-	  || estimated_nr_dies >= low_mem_die_limit
-	  || estimated_nr_dies >= max_die_limit)
+	  || (multifile_mode == 0
+	      && (estimated_nr_dies >= low_mem_die_limit
+		  || estimated_nr_dies >= max_die_limit)))
 	initial_size = default_initial_size;
       else
 	{

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-25 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Only apply die limits in regular mode Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).