andrey          Wed Jun 17 16:21:35 2009 UTC

  Modified files:              
    /php-src/ext/mysqlnd        mysqlnd.h mysqlnd_block_alloc.c 
  Log:
  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.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.28&r2=1.29&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.h
diff -u php-src/ext/mysqlnd/mysqlnd.h:1.28 php-src/ext/mysqlnd/mysqlnd.h:1.29
--- php-src/ext/mysqlnd/mysqlnd.h:1.28  Thu Jun 11 10:08:09 2009
+++ php-src/ext/mysqlnd/mysqlnd.h       Wed Jun 17 16:21:34 2009
@@ -18,13 +18,13 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd.h,v 1.28 2009/06/11 10:08:09 johannes Exp $ */
+/* $Id: mysqlnd.h,v 1.29 2009/06/17 16:21:34 andrey Exp $ */
 
 #ifndef MYSQLND_H
 #define MYSQLND_H
 
-#define MYSQLND_VERSION PHP_VERSION " $Revision: 1.28 $"
-#define MYSQLND_VERSION_ID PHP_VERSION_ID 
+#define MYSQLND_VERSION "mysqlnd/PHP " PHP_VERSION " $Revision: 1.29 $"
+#define MYSQLND_VERSION_ID PHP_VERSION_ID
 
 /* This forces inlining of some accessor functions */
 #define MYSQLND_USE_OPTIMISATIONS 1
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.10 
php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.11
--- php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.10      Tue Jun 16 09:15:09 2009
+++ php-src/ext/mysqlnd/mysqlnd_block_alloc.c   Wed Jun 17 16:21:34 2009
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_block_alloc.c,v 1.10 2009/06/16 09:15:09 andrey Exp $ */
+/* $Id: mysqlnd_block_alloc.c,v 1.11 2009/06/17 16:21:34 andrey Exp $ */
 
 #include "php.h"
 #include "mysqlnd.h"
@@ -63,14 +63,14 @@
                }
                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 @@
        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 @@
        */
        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_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 @@
        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;
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to