diff src/core/ngx_string.h @ 107:b5be4b0448d3

nginx-0.0.1-2003-07-01-19:00:03 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Jul 2003 15:00:03 +0000
parents 7ebc8b7fb816
children 152567c11325
line wrap: on
line diff
--- 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);