Re: [PATCH v2 1/8] alloc.c: remove the alloc_raw_commit_node() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

>  #define DEFINE_ALLOCATOR(name, type)				\
> +static struct alloc_state name##_state;				\
>  void *alloc_##name##_node(void)					\
>  {								\
> +	return alloc_node(&name##_state, sizeof(type));		\
>  }

This is really nice.  Thanks.

> +static struct alloc_state commit_state;
> +
>  void *alloc_commit_node(void)
>  {
>  	static int commit_count;
> -	struct commit *c = alloc_raw_commit_node();
> +	struct commit *c = alloc_node(&commit_state, sizeof(struct commit));
>  	c->index = commit_count++;
>  	return c;
>  }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]