+5
−0
+28
−6
Loading
Gitlab 现已全面支持 git over ssh 与 git over https。通过 HTTPS 访问请配置带有 read_repository / write_repository 权限的 Personal access token。通过 SSH 端口访问请使用 22 端口或 13389 端口。如果使用CAS注册了账户但不知道密码,可以自行至设置中更改;如有其他问题,请发邮件至 service@cra.moe 寻求协助。
Our list_sort() utility has always supported a context argument that
is passed through to the comparison routine. Now there's a use case
for the similar thing for sort().
This implements sort_r by simply extending the existing sort function
in the obvious way. To avoid code duplication, we want to implement
sort() in terms of sort_r(). The naive way to do that is
static int cmp_wrapper(const void *a, const void *b, const void *ctx)
{
int (*real_cmp)(const void*, const void*) = ctx;
return real_cmp(a, b);
}
sort(..., cmp) { sort_r(..., cmp_wrapper, cmp) }
but this would do two indirect calls for each comparison. Instead, do
as is done for the default swap functions - that only adds a cost of a
single easily predicted branch to each comparison call.
Aside from introducing support for the context argument, this also
serves as preparation for patches that will eliminate the indirect
comparison calls in common cases.
Requested-by:
Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by:
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by:
Boris Brezillon <boris.brezillon@collabora.com>
Acked-by:
Andrew Morton <akpm@linux-foundation.org>
Tested-by:
Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by:
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
CRA Git | Maintained and supported by SUSTech CRA and CCSE