git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Wong <e@80x24.org>, git@vger.kernel.org
Subject: Re: [PATCH 2/3] treewide: switch to khashl for memory savings
Date: Wed, 27 Mar 2024 05:37:10 -0400	[thread overview]
Message-ID: <20240327093710.GA847433@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqttksanpj.fsf@gitster.g>

On Tue, Mar 26, 2024 at 10:48:40AM -0700, Junio C Hamano wrote:

> $ make builtin/fast-import.sp ;# part of make sparse
>     SP builtin/fast-import.c
> builtin/fast-import.c: note: in included file (through oidset.h, packfile.h):
> khashl.h:516:1: error: Using plain integer as NULL pointer
> khashl.h:516:1: error: Using plain integer as NULL pointer
> make: *** [Makefile:3237: builtin/fast-import.sp] Error 1
> 
> I found IMPL_GET and IMPL_DEL's use of (h->keys == 0) were giving
> one of these two, and managed to reduce the error to just one with
> the attached patch, but I don't know what the other error is coming
> from.

Probably:

diff --git a/khashl.h b/khashl.h
index 8fcebed237..1e724bbf88 100644
--- a/khashl.h
+++ b/khashl.h
@@ -116,7 +116,7 @@ static kh_inline khint_t __kh_h2b(khint_t hash, khint_t bits) { return hash * 26
 
 #define __KHASHL_IMPL_RESIZE(SCOPE, HType, prefix, khkey_t, __hash_fn, __hash_eq) \
 	SCOPE void prefix##_resize(HType *h, khint_t new_n_buckets) { \
-		khint32_t *new_used = 0; \
+		khint32_t *new_used = NULL; \
 		khint_t j = 0, x = new_n_buckets, n_buckets, new_bits, new_mask; \
 		while ((x >>= 1) != 0) ++j; \
 		if (new_n_buckets & (new_n_buckets - 1)) ++j; \

-Peff


  reply	other threads:[~2024-03-27  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 23:07 [PATCH 0/3] switch to tombstone-free khashl table Eric Wong
2024-03-25 23:07 ` [PATCH 1/3] list-objects-filter: use kh_size API Eric Wong
2024-03-25 23:07 ` [PATCH 2/3] treewide: switch to khashl for memory savings Eric Wong
2024-03-26 17:48   ` Junio C Hamano
2024-03-27  9:37     ` Jeff King [this message]
2024-03-27 21:54       ` Junio C Hamano
2024-03-25 23:07 ` [PATCH 3/3] khashl: fix ensemble lookups on empty table Eric Wong
2024-03-25 23:07 ` [REJECT 4/3] switch to khashl ensemble Eric Wong
2024-03-26 17:40 ` [PATCH 0/3] switch to tombstone-free khashl table Junio C Hamano
2024-04-19 21:31   ` Junio C Hamano
2024-04-19 21:46     ` Eric Wong
  -- strict thread matches above, loose matches on Subject: below --
2024-03-28 10:13 Eric Wong
2024-03-28 10:13 ` [PATCH 2/3] treewide: switch to khashl for memory savings Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327093710.GA847433@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).