You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(3) |
2
|
3
|
4
|
|
5
(13) |
6
(2) |
7
(5) |
8
(4) |
9
(3) |
10
(4) |
11
(4) |
|
12
(7) |
13
|
14
(1) |
15
|
16
|
17
(2) |
18
|
|
19
|
20
|
21
(3) |
22
(8) |
23
(7) |
24
(5) |
25
(4) |
|
26
(6) |
27
|
28
(9) |
29
|
30
(4) |
31
(5) |
|
|
From: Nicholas N. <n.n...@gm...> - 2023-03-30 23:55:58
|
I'd do the simple thing.
BTW, will this actually cause increased memory consumption? I can't
remember the details of Valgrind allocator and whether it involves size
classes. Does an allocation of, say, 40 bytes get rounded up to 48 or
something like that? If so, then you might get this for free. (It probably
depends on how frequently the VLA at the end takes on different sizes.)
Also, if space really is tight here, I wonder if the `next` pointer could
be avoided somehow.
Nick
On Fri, 31 Mar 2023 at 07:37, Paul Floyd <pj...@wa...> wrote:
> Hi
>
> I'm getting towards the end of adding checks for aligned and sized
> allocation / deallocation checks (valid alignment values and that size /
> aligment matches new and delete).
>
> In C++ these checks are not a big deal as the size and alignment used
> with new and delete are normally all dealt with by the compiler. The
> upcoming C23 functions will be more dangerous as the arguments will be
> user-provided.
>
> One thing that is a bit thorny is what to do with MC_Chunk and the
> alignment value that needs storing. At the moment I have
>
> struct _MC_Chunk {
> struct _MC_Chunk* next;
> Addr data; // Address of the actual block.
> SizeT szB : (sizeof(SizeT)*8)-2; // size 30 or 62 bits
> MC_AllocKind allockind : 2; // 2 bits
>
>
> // Added alignment here for now
>
> SizeT alignB;
>
>
> ExeContext* where[0]; // VLA 0 to 2 pointers
> }
>
>
> As it is that will add 1 word overhead per heap allocation.
>
> Wee need at least 6 more bits for the alignment (if we store it as a
> log2). Valgrind imposes a 16Mbyte limit on the alignment, so we need 24
> bits if we store the raw value.
>
>
> The choices that I see are
>
> 1. Take it on the chin and accept the extra overhead.
>
> 2. Make this 64-bit only. As far as I know the largest physical memory
> space implemented in hardware is 52 bits (4 million gigabytes), meaning
> we have 12 bits to spare. That's enough for the log2 value of the
> alignment. 32-bit can't really afford to have more bits of size stolen.
>
> That would mean some ugly code with lots of ifdefs.It would also mean
> not being able to store the original alignment value (which in some
> cases is not necessarily a power of 2).
>
>
> 3. Make this optional.
>
> That would mean something like making a new union
>
> union MC_Extra
> SizeT alignB;
> ExeContext* where;
> };
>
> And then replacing the last element
>
> MC_extra extra[0];
>
> 'extra' would contain 0 to 3 elements, the first the alignment (if
> enabled) and the next 0 to 2 elements as before for where[].
>
> I would use --show-mismatched-frees to control adding the alignment and
> turn it off by default.
>
>
> I don't have a strong personal preference. 1 is the cleanest to
> implement. 2 is hackey but somewhat pragmatic. 3 is a bit of a compromise.
>
> A+
> Paul
>
>
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
>
|
|
From: Mark W. <ma...@so...> - 2023-03-30 23:31:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f32cc294e363f9ea953b22cddcb290954725d83b commit f32cc294e363f9ea953b22cddcb290954725d83b Author: Mark Wielaard <ma...@kl...> Date: Sun Jan 22 23:18:18 2023 +0100 Propagate memory allocation failure to out_of_memory_NORETURN Provide the user with a hint of what caused an out of memory error. And explain that some memory policies, like selinux deny_execmem might cause Permission denied errors. Add an err argument to out_of_memory_NORETURN. And change am_shadow_alloc to return a SysRes (all three callers were already checking for errors and calling out_of_memory_NORETURN). Diff: --- NEWS | 1 + coregrind/m_aspacemgr/aspacemgr-linux.c | 5 ++--- coregrind/m_mallocfree.c | 23 +++++++++++++++++------ coregrind/m_transtab.c | 13 ++++++++----- helgrind/libhb_core.c | 9 ++++++--- include/pub_tool_aspacemgr.h | 2 +- include/pub_tool_mallocfree.h | 5 ++++- memcheck/mc_main.c | 14 ++++++++------ 8 files changed, 47 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 990043fe63..4fd2baf04c 100644 --- a/NEWS +++ b/NEWS @@ -128,6 +128,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 462830 WARNING: unhandled amd64-freebsd syscall: 474 463027 broken check for MPX instruction support in assembler 464476 Firefox fails to start under Valgrind +464680 Show issues caused by memory policies like selinux deny_execmem 464859 Build failures with GCC-13 (drd tsan_unittest) 464969 D language demangling 465435 m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 00a42ffe6e..ae38d8bd05 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2744,10 +2744,9 @@ SysRes VG_(am_mmap_anon_float_valgrind)( SizeT length ) /* Really just a wrapper around VG_(am_mmap_anon_float_valgrind). */ -void* VG_(am_shadow_alloc)(SizeT size) +SysRes VG_(am_shadow_alloc)(SizeT size) { - SysRes sres = VG_(am_mmap_anon_float_valgrind)( size ); - return sr_isError(sres) ? NULL : (void*)(Addr)sr_Res(sres); + return VG_(am_mmap_anon_float_valgrind)( size ); } /* Map a file at an unconstrained address for V, and update the diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index a51c9aa730..b58d471b67 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -37,6 +37,7 @@ #include "pub_core_mallocfree.h" #include "pub_core_options.h" #include "pub_core_threadstate.h" // For VG_INVALID_THREADID +#include "pub_core_syscall.h" // For VG_(strerror) #include "pub_core_gdbserver.h" #include "pub_core_transtab.h" #include "pub_core_tooliface.h" @@ -749,7 +750,7 @@ void ensure_mm_init ( ArenaId aid ) /*------------------------------------------------------------*/ __attribute__((noreturn)) -void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) +void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB, UWord err ) { static Int outputTrial = 0; // We try once to output the full memory state followed by the below message. @@ -760,7 +761,7 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) ULong tot_alloc = VG_(am_get_anonsize_total)(); const HChar* s1 = "\n" - " Valgrind's memory management: out of memory:\n" + " Valgrind's memory management: out of memory: %s\n" " %s's request for %llu bytes failed.\n" " %'13llu bytes have already been mmap-ed ANONYMOUS.\n" " Valgrind cannot continue. Sorry.\n\n" @@ -769,6 +770,9 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) " output of 'ulimit -a'. Is there a limit on the size of\n" " virtual memory or address space?\n" " - You have run out of swap space.\n" + " - You have some policy enabled that denies memory to be\n" + " executable (for example selinux deny_execmem) that causes\n" + " mmap to fail with Permission denied.\n" " - Valgrind has a bug. If you think this is the case or you are\n" " not sure, please let us know and we'll try to fix it.\n" " Please note that programs can take substantially more memory than\n" @@ -801,9 +805,15 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) INNER_REQUEST(VALGRIND_MONITOR_COMMAND("v.info memory aspacemgr")); } outputTrial++; - VG_(message)(Vg_UserMsg, s1, who, (ULong)szB, tot_alloc); + VG_(message)(Vg_UserMsg, s1, + ((err == 0 || err == VKI_ENOMEM) + ? "" : VG_(strerror) (err)), + who, (ULong)szB, tot_alloc); } else { - VG_(debugLog)(0,"mallocfree", s1, who, (ULong)szB, tot_alloc); + VG_(debugLog)(0,"mallocfree", s1, + ((err == 0 || err == VKI_ENOMEM) + ? "" : VG_(strerror) (err)), + who, (ULong)szB, tot_alloc); } VG_(exit)(1); @@ -865,7 +875,7 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB ) // non-client allocation -- abort if it fails sres = VG_(am_mmap_anon_float_valgrind)( cszB ); if (sr_isError(sres)) { - VG_(out_of_memory_NORETURN)("newSuperblock", cszB); + VG_(out_of_memory_NORETURN)("newSuperblock", cszB, sr_Err(sres)); /* NOTREACHED */ sb = NULL; /* keep gcc happy */ } else { @@ -1830,7 +1840,8 @@ void* VG_(arena_malloc) ( ArenaId aid, const HChar* cc, SizeT req_pszB ) a->sblocks_size * 2); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("arena_init", sizeof(Superblock *) * - a->sblocks_size * 2); + a->sblocks_size * 2, + sr_Err(sres)); /* NOTREACHED */ } array = (Superblock**)(Addr)sr_Res(sres); diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c index 384461289d..102108a357 100644 --- a/coregrind/m_transtab.c +++ b/coregrind/m_transtab.c @@ -1574,7 +1574,7 @@ static void initialiseSector ( SECno sno ) sres = VG_(am_mmap_anon_float_valgrind)( 8 * tc_sector_szQ ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TC)", - 8 * tc_sector_szQ ); + 8 * tc_sector_szQ, sr_Err(sres) ); /*NOTREACHED*/ } sec->tc = (ULong*)(Addr)sr_Res(sres); @@ -1583,7 +1583,8 @@ static void initialiseSector ( SECno sno ) ( N_TTES_PER_SECTOR * sizeof(TTEntryC) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TTC)", - N_TTES_PER_SECTOR * sizeof(TTEntryC) ); + N_TTES_PER_SECTOR * sizeof(TTEntryC), + sr_Err(sres)); /*NOTREACHED*/ } sec->ttC = (TTEntryC*)(Addr)sr_Res(sres); @@ -1592,7 +1593,8 @@ static void initialiseSector ( SECno sno ) ( N_TTES_PER_SECTOR * sizeof(TTEntryH) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TTH)", - N_TTES_PER_SECTOR * sizeof(TTEntryH) ); + N_TTES_PER_SECTOR * sizeof(TTEntryH), + sr_Err(sres)); /*NOTREACHED*/ } sec->ttH = (TTEntryH*)(Addr)sr_Res(sres); @@ -1608,7 +1610,8 @@ static void initialiseSector ( SECno sno ) ( N_HTTES_PER_SECTOR * sizeof(TTEno) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(HTT)", - N_HTTES_PER_SECTOR * sizeof(TTEno) ); + N_HTTES_PER_SECTOR * sizeof(TTEno), + sr_Err(sres)); /*NOTREACHED*/ } sec->htt = (TTEno*)(Addr)sr_Res(sres); @@ -2371,7 +2374,7 @@ static void init_unredir_tt_tc ( void ) ( N_UNREDIR_TT * UNREDIR_SZB ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("init_unredir_tt_tc", - N_UNREDIR_TT * UNREDIR_SZB); + N_UNREDIR_TT * UNREDIR_SZB, sr_Err(sres)); /*NOTREACHED*/ } unredir_tc = (ULong *)(Addr)sr_Res(sres); diff --git a/helgrind/libhb_core.c b/helgrind/libhb_core.c index 7c0ea84503..f660a34ea0 100644 --- a/helgrind/libhb_core.c +++ b/helgrind/libhb_core.c @@ -716,10 +716,13 @@ static void* shmem__bigchunk_alloc ( SizeT n ) if (0) VG_(printf)("XXXXX bigchunk: abandoning %d bytes\n", (Int)(shmem__bigchunk_end1 - shmem__bigchunk_next)); - shmem__bigchunk_next = VG_(am_shadow_alloc)( sHMEM__BIGCHUNK_SIZE ); - if (shmem__bigchunk_next == NULL) + SysRes sres = VG_(am_shadow_alloc)( sHMEM__BIGCHUNK_SIZE ); + if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)( - "helgrind:shmem__bigchunk_alloc", sHMEM__BIGCHUNK_SIZE ); + "helgrind:shmem__bigchunk_alloc", sHMEM__BIGCHUNK_SIZE, + sr_Err(sres)); + } + shmem__bigchunk_next = (void*)(Addr)sr_Res(sres);; shmem__bigchunk_end1 = shmem__bigchunk_next + sHMEM__BIGCHUNK_SIZE; } tl_assert(shmem__bigchunk_next); diff --git a/include/pub_tool_aspacemgr.h b/include/pub_tool_aspacemgr.h index 4466345490..163c385d14 100644 --- a/include/pub_tool_aspacemgr.h +++ b/include/pub_tool_aspacemgr.h @@ -153,7 +153,7 @@ extern Bool VG_(am_is_valid_for_client) ( Addr start, SizeT len, UInt prot ); /* Really just a wrapper around VG_(am_mmap_anon_float_valgrind). */ -extern void* VG_(am_shadow_alloc)(SizeT size); +extern SysRes VG_(am_shadow_alloc)(SizeT size); /* Unmap the given address range and update the segment array accordingly. This fails if the range isn't valid for valgrind. */ diff --git a/include/pub_tool_mallocfree.h b/include/pub_tool_mallocfree.h index 8532bba870..ef7096edee 100644 --- a/include/pub_tool_mallocfree.h +++ b/include/pub_tool_mallocfree.h @@ -46,8 +46,11 @@ extern HChar* VG_(strdup) ( const HChar* cc, const HChar* s ); // TODO: move somewhere else // Call here to bomb the system when out of memory (mmap anon fails) +// Provide the VKI errno if possible (normally the result of sr_Err), +// may be zero if unknown. __attribute__((noreturn)) -extern void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ); +extern void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB, + UWord err ); // VG_(perm_malloc) is for allocating small blocks which are // never released. The overhead for such blocks is minimal. diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 3619dd1f92..946813be79 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -309,10 +309,11 @@ static SecMap* copy_for_writing ( SecMap* dist_sm ) || dist_sm == &sm_distinguished[1] || dist_sm == &sm_distinguished[2]); - new_sm = VG_(am_shadow_alloc)(sizeof(SecMap)); - if (new_sm == NULL) + SysRes sres = VG_(am_shadow_alloc)(sizeof(SecMap)); + if (sr_isError(sres)) VG_(out_of_memory_NORETURN)( "memcheck:allocate new SecMap", - sizeof(SecMap) ); + sizeof(SecMap), sr_Err(sres) ); + new_sm = (void *)(Addr)sr_Res(sres); VG_(memcpy)(new_sm, dist_sm, sizeof(SecMap)); update_SM_counts(dist_sm, new_sm); return new_sm; @@ -2543,11 +2544,12 @@ static void init_OCache ( void ) UWord line, set; tl_assert(MC_(clo_mc_level) >= 3); tl_assert(ocacheL1 == NULL); - ocacheL1 = VG_(am_shadow_alloc)(sizeof(OCache)); - if (ocacheL1 == NULL) { + SysRes sres = VG_(am_shadow_alloc)(sizeof(OCache)); + if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)( "memcheck:allocating ocacheL1", - sizeof(OCache) ); + sizeof(OCache), sr_Err(sres) ); } + ocacheL1 = (void *)(Addr)sr_Res(sres); tl_assert(ocacheL1 != NULL); for (set = 0; set < OC_N_SETS; set++) { for (line = 0; line < OC_LINES_PER_SET; line++) { |
|
From: Paul F. <pj...@wa...> - 2023-03-30 20:36:08
|
Hi
I'm getting towards the end of adding checks for aligned and sized
allocation / deallocation checks (valid alignment values and that size /
aligment matches new and delete).
In C++ these checks are not a big deal as the size and alignment used
with new and delete are normally all dealt with by the compiler. The
upcoming C23 functions will be more dangerous as the arguments will be
user-provided.
One thing that is a bit thorny is what to do with MC_Chunk and the
alignment value that needs storing. At the moment I have
struct _MC_Chunk {
struct _MC_Chunk* next;
Addr data; // Address of the actual block.
SizeT szB : (sizeof(SizeT)*8)-2; // size 30 or 62 bits
MC_AllocKind allockind : 2; // 2 bits
// Added alignment here for now
SizeT alignB;
ExeContext* where[0]; // VLA 0 to 2 pointers
}
As it is that will add 1 word overhead per heap allocation.
Wee need at least 6 more bits for the alignment (if we store it as a
log2). Valgrind imposes a 16Mbyte limit on the alignment, so we need 24
bits if we store the raw value.
The choices that I see are
1. Take it on the chin and accept the extra overhead.
2. Make this 64-bit only. As far as I know the largest physical memory
space implemented in hardware is 52 bits (4 million gigabytes), meaning
we have 12 bits to spare. That's enough for the log2 value of the
alignment. 32-bit can't really afford to have more bits of size stolen.
That would mean some ugly code with lots of ifdefs.It would also mean
not being able to store the original alignment value (which in some
cases is not necessarily a power of 2).
3. Make this optional.
That would mean something like making a new union
union MC_Extra
SizeT alignB;
ExeContext* where;
};
And then replacing the last element
MC_extra extra[0];
'extra' would contain 0 to 3 elements, the first the alignment (if
enabled) and the next 0 to 2 elements as before for where[].
I would use --show-mismatched-frees to control adding the alignment and
turn it off by default.
I don't have a strong personal preference. 1 is the cleanest to
implement. 2 is hackey but somewhat pragmatic. 3 is a bit of a compromise.
A+
Paul
|
|
From: Paul F. <pj...@wa...> - 2023-03-30 19:54:14
|
On 29-03-23 00:03, Nicholas Nethercote wrote: > So: is anybody using user annotation? Does anybody see any problems with > this proposal? > > Thanks. > > Nick Hi Nick I don't think that I've ever used it. So no objection from me. A+ Paul |