php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch memcache-uninline.patch for memcache Bug #74045

Patch version 2017-02-05 10:24 UTC

Return to Bug #74045 | Download this patch
Patch Revisions:

Developer: php@bof.de

--- release-5.6.27/memcache/memcache_queue.c	2016-10-20 16:12:02.350165818 +0200
+++ release-5.6.28/memcache/memcache_queue.c	2017-02-05 10:48:49.492274848 +0100
@@ -26,7 +26,7 @@
 #include "php.h"
 #include "memcache_queue.h"
 
-MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *queue, void *ptr) {
+void mmc_queue_push(mmc_queue_t *queue, void *ptr) {
 	if (mmc_queue_contains(queue, ptr)) return;
 
 	if (queue->len >= queue->alloc) {
@@ -53,7 +53,7 @@
 	queue->len++;
 }
 
-MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *queue) {
+void *mmc_queue_pop(mmc_queue_t *queue) {
 	if (queue->len) {
 		void *ptr;
 		
@@ -73,7 +73,7 @@
 	return NULL;
 }
 
-MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *queue, void *ptr) {
+int mmc_queue_contains(mmc_queue_t *queue, void *ptr) {
 	if (queue != NULL) {
 		int i;
 		
@@ -87,14 +87,14 @@
 	return 0;
 }
 
-MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *queue) {
+void mmc_queue_free(mmc_queue_t *queue) {
 	if (queue->items != NULL) {
 		efree(queue->items);
 	}
 	memset(queue, 0, sizeof(*queue));
 }
 
-MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *target, mmc_queue_t *source) {
+void mmc_queue_copy(mmc_queue_t *target, mmc_queue_t *source) {
 	if (target->alloc != source->alloc) {
 		target->alloc = source->alloc;
 		target->items = erealloc(target->items, sizeof(*target->items) * target->alloc);
@@ -106,7 +106,7 @@
 	target->len = source->len;
 }
 
-MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *queue, void *ptr) { 
+void mmc_queue_remove(mmc_queue_t *queue, void *ptr) { 
 	void *item;
 	mmc_queue_t original = *queue;
 	mmc_queue_release(queue);
--- release-5.6.27/memcache/memcache_queue.h	2016-10-20 16:12:02.350165818 +0200
+++ release-5.6.28/memcache/memcache_queue.h	2017-02-05 10:48:24.492635712 +0100
@@ -37,18 +37,12 @@
 #define mmc_queue_reset(q) (q)->len = (q)->head = (q)->tail = 0
 #define mmc_queue_item(q, i) ((q)->tail + (i) < (q)->alloc ? (q)->items[(q)->tail + (i)] : (q)->items[(i) - ((q)->alloc - (q)->tail)]) 
 
-#ifdef PHP_WIN32
-#define MMC_QUEUE_INLINE
-#else
-#define MMC_QUEUE_INLINE inline
-#endif
-
-MMC_QUEUE_INLINE void mmc_queue_push(mmc_queue_t *, void *);
-MMC_QUEUE_INLINE void *mmc_queue_pop(mmc_queue_t *);
-MMC_QUEUE_INLINE int mmc_queue_contains(mmc_queue_t *, void *);
-MMC_QUEUE_INLINE void mmc_queue_free(mmc_queue_t *);
-MMC_QUEUE_INLINE void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
-MMC_QUEUE_INLINE void mmc_queue_remove(mmc_queue_t *, void *);
+extern void mmc_queue_push(mmc_queue_t *, void *);
+extern void *mmc_queue_pop(mmc_queue_t *);
+extern int mmc_queue_contains(mmc_queue_t *, void *);
+extern void mmc_queue_free(mmc_queue_t *);
+extern void mmc_queue_copy(mmc_queue_t *, mmc_queue_t *);
+extern void mmc_queue_remove(mmc_queue_t *, void *);
 
 #endif /*MEMCACHE_QUEUE_H_*/
 
--- release-5.6.27/memcache/memcache_pool.c	2016-10-20 16:12:02.350165818 +0200
+++ release-5.6.28/memcache/memcache_pool.c	2017-02-05 10:49:12.201947040 +0100
@@ -40,7 +40,7 @@
 
 ZEND_DECLARE_MODULE_GLOBALS(memcache)
 
-inline void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size)  /*
+void mmc_buffer_alloc(mmc_buffer_t *buffer, unsigned int size)  /*
 	ensures space for an additional size bytes {{{ */
 {
 	register size_t newlen;
@@ -48,7 +48,7 @@
 }
 /* }}} */
 
-inline void mmc_buffer_free(mmc_buffer_t *buffer)  /* {{{ */
+void mmc_buffer_free(mmc_buffer_t *buffer)  /* {{{ */
 {
 	if (buffer->value.c != NULL) {
 		smart_str_free(&(buffer->value));
@@ -1676,7 +1676,7 @@
 }
 /* }}} */
 
-inline int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len)  /* {{{ */
+int mmc_prepare_key_ex(const char *key, unsigned int key_len, char *result, unsigned int *result_len)  /* {{{ */
 {
 	unsigned int i;
 	if (key_len == 0) {
@@ -1694,7 +1694,7 @@
 }
 /* }}} */
 
-inline int mmc_prepare_key(zval *key, char *result, unsigned int *result_len)  /* {{{ */
+int mmc_prepare_key(zval *key, char *result, unsigned int *result_len)  /* {{{ */
 {
 	if (Z_TYPE_P(key) == IS_STRING) {
 		return mmc_prepare_key_ex(Z_STRVAL_P(key), Z_STRLEN_P(key), result, result_len);
--- release-5.6.27/memcache/memcache_pool.h	2016-10-20 16:12:02.350165818 +0200
+++ release-5.6.28/memcache/memcache_pool.h	2017-02-05 10:46:46.864044956 +0100
@@ -135,8 +135,8 @@
 #define mmc_buffer_release(b) memset((b), 0, sizeof(*(b)))
 #define mmc_buffer_reset(b) (b)->value.len = (b)->idx = 0
 
-inline void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
-inline void mmc_buffer_free(mmc_buffer_t *);
+extern void mmc_buffer_alloc(mmc_buffer_t *, unsigned int);
+extern void mmc_buffer_free(mmc_buffer_t *);
 
 /* stream handlers */
 typedef struct mmc_stream mmc_stream_t;
@@ -391,8 +391,8 @@
 double timeval_to_double(struct timeval tv);
 struct timeval double_to_timeval(double sec);
 
-inline int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
-inline int mmc_prepare_key(zval *, char *, unsigned int *);
+extern int mmc_prepare_key_ex(const char *, unsigned int, char *, unsigned int *);
+extern int mmc_prepare_key(zval *, char *, unsigned int *);
 
 #define mmc_str_left(h, n, hlen, nlen) ((hlen) >= (nlen) ? memcmp((h), (n), (nlen)) == 0 : 0)
 
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Apr 09 05:01:23 2020 UTC