com php-src: Fix bug #63595 GMP memory management conflicts with other libraries using GMP: ext/gmp/gmp.c

From: Date: Mon, 27 Oct 2014 06:45:34 +0000
Subject: com php-src: Fix bug #63595 GMP memory management conflicts with other libraries using GMP: ext/gmp/gmp.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82680@lists.php.net to get a copy of this message
Commit: 3c925b18fa96043e5d7e86f9ce544b143c3c2079 Author: Remi Collet <remi@php.net> Mon, 27 Oct 2014 07:45:34 +0100 Parents: 22b9f16e9ad0f500b73fd6814feb6c00ce749f34 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c925b18fa96043e5d7e86f9ce544b143c3c2079 Log: Fix bug #63595 GMP memory management conflicts with other libraries using GMP Drop use of php memory allocators as this raise various conflicts with other extensions and libraries which use libgmp. No other solution found. We cannot for ensure correct use of allocator with shared lib. Some memory can allocated before php init Some memory can be freed after php shutdown Known broken run cases - php + curl + gnutls + gmp - mod_gnutls + mod_php + gnutls + gmp - php + freetds + gnutls + gmp - php + odbc + freetds + gnutls + gmp - php + php-mapi (zarafa) + gnutls + gmp Bugs: https://bugs.php.net/63595 Changed paths: M ext/gmp/gmp.c Diff: diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f51bd8c..b1553fa 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); # define MAX_BASE 36 #endif -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - /* {{{ ZEND_GINIT_FUNCTION */ static ZEND_GINIT_FUNCTION(gmp) @@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp) #endif REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */

« previous php.cvs (#82680) next »