[Tarantool-patches] [PATCH v12 3/8] module_cache: improve naming

Cyrill Gorcunov gorcunov at gmail.com
Mon Jan 25 01:32:56 MSK 2021


On Sun, Jan 24, 2021 at 05:27:12PM +0100, Vladislav Shpilevoy wrote:
> Thanks for the patch!
> 
> Very dubious commit. To me the old and new names look the same.
> 'func_name' was even better than 'func_name_desc'. At least
> because it was shorter, and 'desc' does not add any more meaning.
> 
> On 18.01.2021 21:35, Cyrill Gorcunov via Tarantool-patches wrote:
> >  - rename func_name to func_name_desc because
> >    it is not just a name but rather a name descriptor
> >    which includes symbol address
> 
> I don't see any address in it. Only name tokens.

struct func_name_desc {
	/**
	 * Null-terminated symbol name, e.g.
	 * "func" for "mod.submod.func".
	 */
--->	const char *sym;
	/**
	 * Package name, e.g. "mod.submod" for
	 * "mod.submod.func".
	 */
	const char *package;
	/**
	 * A pointer to the last character in ->package + 1.
	 */
	const char *package_end;
};

I marked the address. The structure is not a function name
but consists of two parts - package path and function name
itself and maybe something new will be added in future. So
func_name is suitable for plain names but not for strings
where some part of it has a special meaning with hidden
extension inside, hereby a descriptor. And don't forget
about grepability, without this name change grep returns
a number of irrelevant results.


More information about the Tarantool-patches mailing list