From: Jeff King Date: Mon, 06 Jul 2026 00:44:01 GMT Subject: Re: [PATCH 7/9] http: discard hash in dumb-http http_object_request Message-ID: <20260706004401.GA2308672@coredump.intra.peff.net> In-Reply-To: <20260706000105.GA2301945@coredump.intra.peff.net> On Sun, Jul 05, 2026 at 08:01:05PM -0400, Jeff King wrote: > That by itself is enough to make: > > algo->init_fn(&ctx); > git_hash_update(&ctx, ...); > git_hash_final(out, &ctx); > ... > git_hash_discard(&ctx); > > safe. Actually, that's not quite true. Setting the active flag happens in git_hash_init() in that model. But many callers use algo->init_fn() directly instead. They'd all need to be adjusted to use git_hash_init(). I don't think there's any reason they should avoid it, and it's mostly from inertia that they use the bare function pointer. -Peff