You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ivan Zhakov <iv...@visualsvn.com> on 2011/07/12 17:20:16 UTC

[PATCH] Use dedicated Windows heap for each apr_allocator_t

Hi,

Please find attached patch that adds an option
(APR_ALLOCATOR_USE_WIN32_HEAP) to use dedicated Windows heap for each
apr_allocator_t. Using dedicated heaps for APR allocator should reduce
memory fragmentation for mutli-thread application like Apache HTTPD on
Windows.

Log message:
[[[
* memory/unix/apr_pools
  (apr_allocator_t): Add heap member if APR_ALLOCATOR_USE_WIN32_HEAP is defined.
  (apr_allocator_create): Create Windows heap if
APR_ALLOCATOR_USE_WIN32_HEAP is defined.
  (apr_allocator_destroy): Destroy dedicated heap if
APR_ALLOCATOR_USE_WIN32_HEAP is defined. All unfreed memory
  will be destroyed automatically.
 (allocator_alloc): Use HeapAlloc if APR_ALLOCATOR_USE_WIN32_HEAP is defined.
 (apr_pool_create_unmanaged_ex): Use apr_allocator_create() to create
apr_allocator_t instance if
  APR_ALLOCATOR_USE_WIN32_HEAP is defined
]]]

-- 
Ivan Zhakov