alloc.c: remove the alloc_raw_commit_node() function
commit225ea22046a1193bd934a8ea308fa4a7788c9796
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Sun, 13 Jul 2014 06:41:41 +0000 (13 02:41 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 01:59:04 +0000 (13 18:59 -0700)
tree0029d079de66eaf739962e2230536e10fe508c98
parent8061ae8b4618d69a67ff6cfb687d7044964d4b04
alloc.c: remove the alloc_raw_commit_node() function

In order to encapsulate the setting of the unique commit index, commit
969eba63 ("commit: push commit_index update into alloc_commit_node",
10-06-2014) introduced a (logically private) intermediary allocator
function. However, this function (alloc_raw_commit_node()) was declared
as a public function, which undermines its entire purpose.

Introduce an inline function, alloc_node(), which implements the main
logic of the allocator used by DEFINE_ALLOCATOR, and redefine the macro
in terms of the new function. In addition, use the new function in the
implementation of the alloc_commit_node() allocator, rather than the
intermediary allocator, which can now be removed.

Noticed by sparse ("symbol 'alloc_raw_commit_node' was not declared.
Should it be static?").

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
alloc.c