mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 08:12:27 -04:00
Call into SIMD strlen and stpcpy for an optimized strcat. Port of D42600 for amd64. Tested by: fuz (exprun) Reviewed by: fuz, emaste Sponsored by: Google LLC (GSoC 2024) PR: 281175 Differential Revision: https://reviews.freebsd.org/D46417
20 lines
344 B
C
20 lines
344 B
C
/*-
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2024 Getz Mikalsen <getz@FreeBSD.org>
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#undef strcat /* _FORTIFY_SOURCE */
|
|
|
|
char *
|
|
strcat(char * __restrict s, const char * __restrict append)
|
|
{
|
|
char *save = s;
|
|
|
|
/* call into SIMD optimized functions */
|
|
stpcpy(s + strlen(s), append);
|
|
|
|
return(save);
|
|
}
|