Browse Source

- This should improve performance on Windows

experimental/new_apache_hooks
Andi Gutmans 24 years ago
parent
commit
90f43c78b0
  1. 22
      Zend/zend.h
  2. 4
      Zend/zend_hash.h

22
Zend/zend.h

@ -54,6 +54,18 @@
# define ZEND_PATHS_SEPARATOR ':'
#endif
#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
are covered by its case statements */
#define EMPTY_SWITCH_DEFAULT_CASE() \
default: \
__assume(0); \
break;
#else
#define EMPTY_SWITCH_DEFAULT_CASE()
#endif
/* all HAVE_XXX test have to be after the include of zend_config above */
#ifdef HAVE_UNIX_H
@ -541,16 +553,6 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval
#define ZEND_MAX_RESERVED_RESOURCES 4
#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
are covered by its case statements */
#define EMPTY_SWITCH_DEFAULT_CASE() \
default: \
__assume(0); \
break;
#else
#define EMPTY_SWITCH_DEFAULT_CASE()
#endif
#endif /* ZEND_H */

4
Zend/zend_hash.h

@ -21,6 +21,7 @@
#define ZEND_HASH_H
#include <sys/types.h>
#include "zend.h"
#define HASH_KEY_IS_STRING 1
#define HASH_KEY_IS_LONG 2
@ -244,7 +245,8 @@ static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength)
case 3: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 2: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 1: hash = ((hash << 5) + hash) + *arKey++; break;
default: /* case 0: */ break;
case 0: break;
EMPTY_SWITCH_DEFAULT_CASE()
}
return hash;
}

Loading…
Cancel
Save