diff options
author | Nikita Popov <nikic@php.net> | 2016-02-22 17:33:41 +0100 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-02-22 19:40:32 +0100 |
commit | 42fe5e6791bb0adca2b4bc0373007a9f776e3d8a (patch) | |
tree | 56eeaf2c53a0e209e8ddb88609547fc46c5f8866 /ext/mysqlnd | |
parent | 79db0859f0e18e7b1b487c57150b1cad0f296bfb (diff) | |
download | php-git-42fe5e6791bb0adca2b4bc0373007a9f776e3d8a.tar.gz |
Drop mysqlnd mempool refcount
This member was no longer used.
Also fix handling of from_pool in resize_chunk. It was setting
pool to NULL instead of from_pool to FALSE.
Diffstat (limited to 'ext/mysqlnd')
-rw-r--r-- | ext/mysqlnd/mysqlnd_block_alloc.c | 9 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_structs.h | 1 |
2 files changed, 2 insertions, 8 deletions
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index 0897c65a64..d92fd755d8 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -41,7 +41,6 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk) */ pool->free_size += chunk->size; } - pool->refcount--; } else { mnd_efree(chunk->ptr); } @@ -74,8 +73,7 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz chunk->ptr = new_ptr; pool->free_size += chunk->size; chunk->size = size; - chunk->pool = NULL; /* now we have no pool memory */ - pool->refcount--; + chunk->from_pool = FALSE; /* now we have no pool memory */ } else { /* If the chunk is > than asked size then free_memory increases, otherwise decreases*/ pool->free_size += (chunk->size - size); @@ -93,8 +91,7 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz memcpy(new_ptr, chunk->ptr, chunk->size); chunk->ptr = new_ptr; chunk->size = size; - chunk->pool = NULL; /* now we have non-pool memory */ - pool->refcount--; + chunk->from_pool = FALSE; /* now we have non-pool memory */ } } } else { @@ -136,7 +133,6 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool } } else { chunk->from_pool = TRUE; - ++pool->refcount; chunk->ptr = pool->arena + (pool->arena_size - pool->free_size); /* Last step, update free_size */ pool->free_size -= size; @@ -157,7 +153,6 @@ mysqlnd_mempool_create(size_t arena_size) if (ret) { ret->get_chunk = mysqlnd_mempool_get_chunk; ret->free_size = ret->arena_size = arena_size ? arena_size : 0; - ret->refcount = 0; /* OOM ? */ ret->arena = mnd_emalloc(ret->arena_size); if (!ret->arena) { diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index cc5e2b7ac4..f3813eeb31 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -59,7 +59,6 @@ typedef struct st_mysqlnd_memory_pool_chunk_llist MYSQLND_MEMORY_POOL_CHUNK_LLIS struct st_mysqlnd_memory_pool { zend_uchar *arena; - unsigned int refcount; unsigned int arena_size; unsigned int free_size; |