Re: [PATCH v2 3/8] move setting of object-type to alloc_* functions

2014-07-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: diff --git a/alloc.c b/alloc.c index 03e458b..fd2e32d 100644 --- a/alloc.c +++ b/alloc.c @@ -52,6 +52,7 @@ static struct alloc_state blob_state; void *alloc_blob_node(void) { struct blob *b = alloc_node(blob_state, sizeof(struct blob)); +

[PATCH v2 3/8] move setting of object-type to alloc_* functions

2014-07-13 Thread Jeff King
The struct object type implements basic object polymorphism. Individual instances are allocated as concrete types (or as a union type that can store any object), and a struct object * can be cast into its real type after examining its type enum. This means it is dangerous to have a type field