summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_block_alloc.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2009-06-17 16:22:13 +0000
committerAndrey Hristov <andrey@php.net>2009-06-17 16:22:13 +0000
commit0aada076568949db76a6487d3bee9bae9929fa01 (patch)
tree7221922af004e2150835a53ed97d50fb41a16a4d /ext/mysqlnd/mysqlnd_block_alloc.c
parent219c2603bb7a13c64a9cd1d5a741b32ea0af7801 (diff)
downloadphp-git-0aada076568949db76a6487d3bee9bae9929fa01.tar.gz
MFH:
Fix two problems: - The value of mysqli_get_client_info() has been changed recently and did not include "mysqlnd" anymore thus the test suite was thinking the build is always libmysql. This did not kept the suite from running pconn tests - Going back to the libc allocator because the memory arena could be on a persistent connections. If the build is not debug there will be no error but the memory will be freed and in the second use of this pconn freed memory will be used - not good! For now the arena doesn't take an argument whether it should allocate persistently or not, thus persistent is safe for now. Johannes gave his +1 to commit this.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_block_alloc.c')
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index 19442c5970..a9e2896049 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -63,14 +63,14 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it
}
pool->refcount--;
} else {
- mnd_efree(chunk->ptr);
+ mnd_free(chunk->ptr);
}
if (cache_it && pool->free_chunk_list_elements < MYSQLND_MEMORY_POOL_CHUNK_LIST_SIZE) {
chunk->ptr = NULL;
pool->free_chunk_list[pool->free_chunk_list_elements++] = chunk;
} else {
/* We did not cache it -> free it */
- mnd_efree(chunk);
+ mnd_free(chunk);
}
DBG_VOID_RETURN;
}
@@ -135,7 +135,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
if (pool->free_chunk_list_elements) {
chunk = pool->free_chunk_list[--pool->free_chunk_list_elements];
} else {
- chunk = mnd_emalloc(sizeof(MYSQLND_MEMORY_POOL_CHUNK));
+ chunk = mnd_malloc(sizeof(MYSQLND_MEMORY_POOL_CHUNK));
}
chunk->size = size;
@@ -146,7 +146,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
*/
chunk->pool = pool;
if (size > pool->free_size) {
- chunk->ptr = mnd_emalloc(size);
+ chunk->ptr = mnd_malloc(size);
chunk->from_pool = FALSE;
} else {
chunk->from_pool = TRUE;
@@ -165,13 +165,13 @@ MYSQLND_MEMORY_POOL *
mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
{
/* We calloc, because we free(). We don't mnd_calloc() for a reason. */
- MYSQLND_MEMORY_POOL * ret = mnd_ecalloc(1, sizeof(MYSQLND_MEMORY_POOL));
+ MYSQLND_MEMORY_POOL * ret = mnd_calloc(1, sizeof(MYSQLND_MEMORY_POOL));
DBG_ENTER("mysqlnd_mempool_create");
ret->free_size = ret->arena_size = arena_size;
ret->refcount = 0;
/* OOM ? */
- ret->arena = mnd_emalloc(ret->arena_size);
+ ret->arena = mnd_malloc(ret->arena_size);
ret->get_chunk = mysqlnd_mempool_get_chunk;
DBG_RETURN(ret);
@@ -187,8 +187,8 @@ mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
if (pool) {
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
mysqlnd_mempool_free_contents(pool TSRMLS_CC);
- mnd_efree(pool->arena);
- mnd_efree(pool);
+ mnd_free(pool->arena);
+ mnd_free(pool);
}
DBG_VOID_RETURN;
}