[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stackvma.c vs. vma-iter.c
From: |
Bruno Haible |
Subject: |
Re: stackvma.c vs. vma-iter.c |
Date: |
Sun, 30 May 2021 00:53:11 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) |
Hi Paul,
> stackvma.c says it contains simplified copies of code in vma-iter.c,
> which didn't have this bug. Bruno, am I right in guessing that there are
> two files mainly because libsigsegv was separate from Gnulib?
They are still two separate files because
- They have different purposes: A generic iteration over VMAs, vs. a
specific use of VMAs.
- The code for reading the maps file is not present on some platforms
(e.g. on Minix) in stackvma.c, because on Minix programs can't catch
SIGSEGV anyway.
> Should we
> be working to unify the two files, so that fixes to one also fix the other?
To me, that's hardly worth it, because the code compiles to only 1 KB of
machine code on most platforms, therefore there's little incentive in
removing the duplication.
It's more important that stackvma.c remains in sync with
libsigsegv/src/stackvma-*.
But if there's obvious improvements that can be made, please say so, and
I'll apply them to stackvma.c and libsigsegv in sync.
Bruno