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

[PATCH 3/3] fixup! reftable: add a heap-based priority queue for reftable records

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Sep 2, 2021, 05:30 UTC
Message-ID
<20210902053023.44006-4-carenas@gmail.com>
In-Reply-To
<20210902053023.44006-1-carenas@gmail.com>

not a very useful option, but the fact the main logic is done inside and assert that then gets compiled out when -DNDEBUG might be worth reconsidering.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 reftable/pq.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/reftable/pq.c b/reftable/pq.c
index 8918d158e2..a6acca006b 100644
--- a/reftable/pq.c
+++ b/reftable/pq.c
@@ -43,12 +43,14 @@ int merged_iter_pqueue_is_empty(struct merged_iter_pqueue pq)
 
 void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
 {
+#ifndef NDEBUG
 	int i = 0;
 	for (i = 1; i < pq.len; i++) {
 		int parent = (i - 1) / 2;
 
 		assert(pq_less(pq.heap[parent], pq.heap[i]));
 	}
+#endif
 }
 
 struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq)
-- 
2.33.0.481.g26d3bed244
Previous: Carlo Marcelo Arenas BelónNext: Jeff King
Message 6 of 10 in “hn/reftable: fixes for building with -DNDEBUG”
  1. 0/3 hn/reftable: fixes for building with -DNDEBUGCarlo Marcelo Arenas Belón, Sep 2, 2021
  2. 1/3 fixup! refs: RFC: Reftable support for git-coreCarlo Marcelo Arenas Belón, Sep 2, 2021
  3. Jeff KingSep 2, 2021
  4. Han-Wen NienhuysSep 2, 2021
  5. 2/3 fixup! reftable: add merged table viewCarlo Marcelo Arenas Belón, Sep 2, 2021
  6. 3/3 fixup! reftable: add a heap-based priority queue for reftable recordsCarlo Marcelo Arenas Belón, Sep 2, 2021
  7. Jeff KingSep 2, 2021
  8. Junio C HamanoSep 2, 2021
  9. Jeff KingSep 2, 2021
  10. Junio C HamanoSep 3, 2021

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.