Thread (39 messages) flat view 39 messages, 5 authors, 2018-08-15

Re: [PATCHv3 2/6] alloc: make allocate_alloc_state and clear_alloc_state more consistent

From: Jonathan Nieder <hidden>
Date: 2018-08-15 05:18:30

Elijah Newren wrote:
Since both functions are using the same data type, they should either both
refer to it as void *, or both use the real type (struct alloc_state *).
Opt for the latter.

Signed-off-by: Elijah Newren <redacted>
---
 alloc.c | 2 +-
 alloc.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
This API comes from 14ba97f8 (alloc: allow arbitrary repositories for
alloc functions, 2018-05-15).  The pointer returned by
allocate_alloc_state points to an initialized, usable object so
returning a struct instead of a void pointer is the right thing to do.
Thanks for noticing and fixing it.

That commit in turn was probably inspired by v1.5.2-rc0~16^2 (Clean up
object creation to use more common code, 2007-04-16), which was
following the same convention (void * for raw memory, struct blob *
for initialized object).

Reviewed-by: Jonathan Nieder <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help