@mpranj will do an optimization that a keyNew does not have multiple allocations, but only one which creates one block that includes struct+name+string.
With the current keyVInit API (which already takes an allocated Key) we would need to process the vaargs twice, which is troublesome for some architectures.
Another solution would be that keyVInit also returns a key and does the allocation itself when a null pointer is passed.
@manuelm This would support both use cases well, wouldn't it?
It might break the ABI between your bindings and libelektra, though.
Implement it and see if it breaks. If it breaks, fix it. There's nothing to ask me for.
I hoped we could avoid a break+fix cycle. You investigated some time in keyVInit and I hoped you have some solution which will work for your bindings but allow to pass externally allocated memory.
Most helpful comment
Implement it and see if it breaks. If it breaks, fix it. There's nothing to ask me for.