[CRIU] [RFC 0/3] compel: Ship std_ string helpers

Cyrill Gorcunov gorcunov at gmail.com
Fri Jan 27 09:46:05 PST 2017


On Fri, Jan 27, 2017 at 08:30:56PM +0300, Dmitry Safonov wrote:
> 
> Well, I would prefer them to be without this `std_` prefix and don't
> use them explicitely where it's not needed. That would be handy.

This might be handy from "reading" perspective but the key moment
here is to be able to easily find where our own function is used
without side effects. Say if you look into code and see std_memset
you know that this is _exactly_ this function is used, not some
"weak" alias or compiler builtin. The reason why kernel provides
own plain "memset" is that kernel doesn't use any external library
at all, thus once you see memset there it's definitely one from
the own library. The situation with criu is different -- we use
system libraries a lot with one exception -- PIE code. Some of
our C files are used for both -- pie compilation and ordinary
program, and we can use std_memset for both without expecting
any side effect.

> But, I know your concern here about naming conflicts and so I'm not
> objecting patches. Looks good to me, let's clean that {std_,builtin_,}*
> mess.

	Cyrill


More information about the CRIU mailing list