alloc.c: remove the alloc_raw_commit_node() function
commit8c3f3f28cb8c946867365292abfc2c33a5707d3e
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, 28 Jul 2014 17:14:33 +0000 (28 10:14 -0700)
tree236920cc2b6eeaf41c0a02385ae8dcb6047082bd
parent740c281d21ef5b27f6f1b942a4f2fc20f51e8c7e
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