diff options
author | Andrey Hristov <andrey@php.net> | 2009-06-17 16:22:13 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2009-06-17 16:22:13 +0000 |
commit | 0aada076568949db76a6487d3bee9bae9929fa01 (patch) | |
tree | 7221922af004e2150835a53ed97d50fb41a16a4d | |
parent | 219c2603bb7a13c64a9cd1d5a741b32ea0af7801 (diff) | |
download | php-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.
-rw-r--r-- | ext/mysqlnd/mysqlnd.h | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_block_alloc.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 4f437a468d..ba3afed3e0 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -23,7 +23,7 @@ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION PHP_VERSION " $Revision$" +#define MYSQLND_VERSION "mysqlnd/PHP " PHP_VERSION " $Revision$" #define MYSQLND_VERSION_ID PHP_VERSION_ID /* This forces inlining of some accessor functions */ 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; } |