From: Dmitry Stogov Date: Wed, 25 Jul 2007 11:13:00 +0000 (+0000) Subject: Fixed bug #41713 (Persistent memory consumption on win32 since 5.2) X-Git-Tag: php-5.2.4RC1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0ef6e9a95bfd143324a7bffef99779725213e5b;p=php Fixed bug #41713 (Persistent memory consumption on win32 since 5.2) --- diff --git a/NEWS b/NEWS index 8056a54b04..be6e96bff8 100644 --- a/NEWS +++ b/NEWS @@ -117,6 +117,7 @@ PHP NEWS - Fixed bug #41711 (NULL temporary lobs not supported in OCI8). (Chris Jones, Tony) - Fixed bug #41770 (SSL: fatal protocol error due to buffer issues). (Ilia) +- Fixed bug #41713 (Persistent memory consumption on win32 since 5.2). (Dmitry) - Fixed bug #41709 (strtotime() does not handle 00.00.0000). (Derick) - Fixed bug #41698 (float parameters truncated to integer in prepared statements). (Ilia) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index f6d61b4d50..7801750b90 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1560,6 +1560,15 @@ ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent free(heap); } } else { +#ifdef HAVE_MEM_WIN32 + /* FIX for bug #41713 */ + /* TODO: add new "compact" handler */ + if (storage->handlers->dtor == zend_mm_mem_win32_dtor && + storage->handlers->init == zend_mm_mem_win32_init) { + HeapDestroy((HANDLE)storage->data); + storage->data = (void*)HeapCreate(HEAP_NO_SERIALIZE, 0, 0); + } +#endif heap->segments_list = NULL; zend_mm_init(heap); heap->real_size = 0;