aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_string.h')
-rw-r--r--src/core/ngx_string.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index 036194bde..73ed43a95 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -18,8 +18,6 @@ typedef struct {
#if (WIN32)
-#define ngx_memzero ZeroMemory
-
#define ngx_strncasecmp strnicmp
#define ngx_strcasecmp stricmp
#define ngx_strncmp strncmp
@@ -32,8 +30,6 @@ typedef struct {
#else
-#define ngx_memzero bzero
-
#define ngx_strncasecmp strncasecmp
#define ngx_strcasecmp strcasecmp
#define ngx_strncmp strncmp
@@ -46,9 +42,19 @@ typedef struct {
#endif
+/*
+ * msvc and icc compile memset() to inline "rep stos"
+ * while ZeroMemory and bzero are calls.
+ */
+#define ngx_memzero(buf, n) memset(buf, n, 0)
+
+/* msvc and icc compile memcpy() to inline "rep movs" */
#define ngx_memcpy(dst, src, n) memcpy(dst, src, n)
#define ngx_cpymem(dst, src, n) ((char *) memcpy(dst, src, n)) + n
+/* msvc and icc compile memcmp() to inline loop */
+#define ngx_memcmp memcmp
+
char *ngx_cpystrn(char *dst, char *src, size_t n);
int ngx_rstrncmp(char *s1, char *s2, size_t n);
int ngx_atoi(char *line, size_t n);