Thread (20 messages) 20 messages, 4 authors, 18d ago

Re: [PATCH 7/9] http: discard hash in dumb-http http_object_request

From: Jeff King <hidden>
Date: 2026-07-06 00:44:02

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help