git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mem-pool: fix big allocations

From
René Scharfe <l.s.r@web.de>
Date
Dec 29, 2023, 06:53 UTC
Message-ID
<0dd59d8e-0175-43ef-893d-3352a3f5f1c4@web.de>
In-Reply-To
<48821d3f-2e30-4bce-b9e8-e4199c24e251@gmail.com>
Am 28.12.23 um 20:34 schrieb phillip.wood123@gmail.com:
Show 5 quoted lines
>
> Exactly, my worry is that if the comparison fails it is likely that
> there will have been undefined behavior involved in calculating the
> pointer before we get to the comparison in which case so casting to
> uintptr_t in the comparison does not help.

If there's undefined behavior (UB) somewhere in the test or the tested unit then the compiler could skip any checks and report success anyway. Not adding UB in the test framework and tests is the least we can do.

Perhaps disabling link-time optimization would allow us to shield the unit tests from UB in the tested code, in the sense that the compiler would then not be able to skip checks.

René
Previous: phillip.wood123@gmail.comNext: René Scharfe
Message 9 of 12 in “mem-pool: fix big allocations”
  1. mem-pool: fix big allocationsRené Scharfe, Dec 21, 2023
  2. Elijah NewrenDec 24, 2023
  3. René ScharfeDec 24, 2023
  4. Phillip WoodDec 28, 2023
  5. René ScharfeDec 28, 2023
  6. phillip.wood123@gmail.comDec 28, 2023
  7. René ScharfeDec 28, 2023
  8. phillip.wood123@gmail.comDec 28, 2023
  9. René ScharfeDec 29, 2023
  10. mem-pool: fix big allocationsRené Scharfe, Dec 28, 2023
  11. phillip.wood123@gmail.comDec 28, 2023
  12. Taylor BlauJan 2, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.