From d6e24d96a84d1b561f2259f793dd00b914f4d9f3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 20 Dec 2022 05:35:06 +0200 Subject: [PATCH 37/37] Clarify pf_fuel_pos_replace() header See osdn #46149 Signed-off-by: Marko Lindqvist --- common/aicore/path_finding.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/aicore/path_finding.c b/common/aicore/path_finding.c index e135f786d5..1dd6c04813 100644 --- a/common/aicore/path_finding.c +++ b/common/aicore/path_finding.c @@ -2254,8 +2254,10 @@ static inline void pf_fuel_pos_unref(struct pf_fuel_pos *pos) } /************************************************************************//** - Replace the position (unreferences it). Instead of destroying, re-use the - memory, else return a newly allocated position. + Replace the position. Reference count of the old pos is reduced by one, + but it likely lives on via other references. + If reference count goes to zero, re-use the memory instead of + freeing and allocating again. ****************************************************************************/ static inline struct pf_fuel_pos * pf_fuel_pos_replace(struct pf_fuel_pos *pos, const struct pf_fuel_node *node) -- 2.35.1