From: Karthik Nayak Date: Wed, 19 Nov 2025 10:14:28 GMT Subject: Re: [PATCH 06/18] streaming: create structure for in-core object streams Message-ID: In-Reply-To: <20251119-b4-pks-odb-read-stream-v1-6-adacf03c2ccf@pks.im> Patrick Steinhardt writes: > @@ -426,22 +429,24 @@ static int open_istream_incore(struct odb_read_stream **out, > const struct object_id *oid) > { > struct object_info oi = OBJECT_INFO_INIT; > - struct odb_read_stream stream = { > - .close = close_istream_incore, > - .read = read_istream_incore, > - }; > + struct odb_incore_read_stream stream = { > + .base.close = close_istream_incore, > + .base.read = read_istream_incore, > + }, *st; Nit: Almost missed this `*st`. I wonder if its more readable as a separate line: struct odb_incore_read_stream *st; All good otherwise. > int ret; > > - oi.typep = &stream.type; > - oi.sizep = &stream.size; > - oi.contentp = (void **)&stream.u.incore.buf; > + oi.typep = &stream.base.type; > + oi.sizep = &stream.base.size; > + oi.contentp = (void **)&stream.buf; > ret = odb_read_object_info_extended(r->objects, oid, &oi, > OBJECT_INFO_DIE_IF_CORRUPT); > if (ret) > return ret; > > - CALLOC_ARRAY(*out, 1); > - **out = stream; > + CALLOC_ARRAY(st, 1); > + *st = stream; > + *out = &st->base; > + > return 0; > } > > > -- > 2.52.0.rc2.482.gaa765fefd0.dirty