summaryrefslogtreecommitdiff
path: root/memory
Commit message (Collapse)AuthorAgeFilesLines
* backport r979891:sf2011-10-151-0/+1
| | | | | | | | | | | | | | Fix various issues found by cppcheck - error handling issues - use of uninitialized data - null pointer dereference - unused variables - memory/fd leaks - broken code in threadproc/beos/proc.c git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1183724 13f79535-47bb-0310-9956-ffa450edef68
* Backport r1130270, r1130274:sf2011-06-011-1/+6
| | | | | | | Fix crash with --enable-allocator-uses-mmap on machines with pagesize >= 8k. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1130276 13f79535-47bb-0310-9956-ffa450edef68
* Merge r892387 from trunk:trawick2011-03-211-11/+20
| | | | | | | | | | Cleanups for various gcc warnings, conditional assignment and type errors Submitted by: wrowe Reviewed by: trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083810 13f79535-47bb-0310-9956-ffa450edef68
* Backport r1072165:sf2011-03-201-1/+40
| | | | | | | | | | | | | | | | | Add new configure option --enable-allocator-uses-mmap to use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces memory fragmentation with malloc implementations (e.g. glibc) that don't handle allocationss of a page-size-multiples in an efficient way. It also makes apr_allocator_max_free_set() actually have some effect on such platforms. The handling of page sizes other than 4k seems like a lot of trouble for a very small number of platforms, but there does not seem to be a reasonable way to check this at compile time. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083592 13f79535-47bb-0310-9956-ffa450edef68
* Backport of r990435sf2011-03-201-7/+7
| | | | | | | | | | Fix various off-by-one errors related to current_free_index: current_free_index counts pages of size BOUNDARY_SIZE, but every node contains index + 1 of such pages git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083585 13f79535-47bb-0310-9956-ffa450edef68
* SECURITY: CVE-2009-2412 (cve.mitre.org)wrowe2009-08-041-7/+15
| | | | | | | | | | | | | | | Fix overflow in pools and rmm, where size alignment was taking place. Reported by: Matt Lewis <mattlewis@google.com> memory/unix/apr_pools.c (allocator_alloc, apr_palloc): Check for overflow after aligning size. (apr_pcalloc): Drop aligning of size; clearing what the caller asked for should suffice. Submitted by: Matt Lewis <mattlewis@google.com>, Sander Striker Backports: 800730 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@800731 13f79535-47bb-0310-9956-ffa450edef68
* Use the free_cleanup list for both post and pre cleanup listsmturk2009-04-021-11/+5
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@761345 13f79535-47bb-0310-9956-ffa450edef68
* Use correct array for pre_cleanupsmturk2008-07-191-2/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@678139 13f79535-47bb-0310-9956-ffa450edef68
* Rename apr_pool_create_core to apr_pool_create_unmanaged and deprecate the ↵mturk2008-07-091-2/+41
| | | | | | original API git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@675117 13f79535-47bb-0310-9956-ffa450edef68
* Revert r647394. The API is incomplete and needs more developmentmturk2008-04-161-81/+18
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@648527 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_pool_pre_cleanup_register implementation.mturk2008-04-121-0/+24
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@647447 13f79535-47bb-0310-9956-ffa450edef68
* Introduce apr_pool_sys_allocator_setmturk2008-04-121-18/+81
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@647394 13f79535-47bb-0310-9956-ffa450edef68
* Introduce apr_pool_pre_cleanup_registermturk2008-04-121-0/+47
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@647390 13f79535-47bb-0310-9956-ffa450edef68
* Introduce apr_pool_create_core_exmturk2008-04-121-0/+148
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@647384 13f79535-47bb-0310-9956-ffa450edef68
* Factor out node free space calculation, and fix off-by-one in the usejorton2008-04-071-4/+6
| | | | | | | | | | | | | thereof: * memory/unix/apr_pools.c (node_free_space): New macro. (apr_palloc, psprintf_flush): Use it; correctly compare against free space using <= rather than <. Submitted by: Maxim Yegorushkin <maxim.yegorushkin gmail.com>, jorton git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@645436 13f79535-47bb-0310-9956-ffa450edef68
* Complete commit 488084; not only the documentation, but detection of underflow!wrowe2007-10-171-2/+8
| | | | | | | | PR: 40955 Submitted by: Peter Steiner <peter.steiner+apache hugwi.ch> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@585357 13f79535-47bb-0310-9956-ffa450edef68
* Update apr_atomic_init documentation. PR: 42760.davi2007-06-291-0/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@551962 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (apr_pool_log_event): Fix compiler warningjorton2007-01-121-4/+4
| | | | | | | with verbose pool debugging enabled on LP64 platforms. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@495651 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (apr_pool_initialize): Fix possible crashjorton2007-01-071-2/+10
| | | | | | | | | | with verbose debugging enabled. PR: 41063 Submitted by: Peter Steiner <peter.steiner+apache hugwi.ch> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@493838 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (pool_clear_debug): Fix pointer subtraction.jorton2007-01-071-1/+1
| | | | | | | | PR: 41063 Submitted by: Peter Steiner <peter.steiner+apache hugwi.ch> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@493834 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.cstriker2006-12-181-0/+23
| | | | | | | | | | (apr_allocator_t): Add comments for struct members. Submitted by: Peter Steiner <peter.steiner+apache hugwi.ch> PR: 40955 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@488084 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.jorton2006-08-031-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.jorton2006-08-031-6/+6
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* Don't allow apr_pool_parent_get() to return a NULL pointer. Since there ↵bnicholes2006-06-021-1/+1
| | | | | | aren't any process boundaries on NetWare which makes the global_pool global to all applications, return the application specific pool as the global_pool. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@411301 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (apr_pool_create_ex): Revert previousjorton2006-03-101-1/+5
| | | | | | | change; add comment. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@384722 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (apr_pool_create_ex): Remove a redundantjorton2006-03-091-1/+1
| | | | | | | | test; global_pool is guaranteed to be non-NULL, so parent is guaranteed to be non-NULL here. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@384465 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (pool_clear_debug): Scribble over blocksjorton2005-10-251-2/+9
| | | | | | | | with a poison byte before freeing them to help highlight use-after-free bugs. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@328355 13f79535-47bb-0310-9956-ffa450edef68
* Decrement apr_pools_initialized in the debug version of apr_pool_termiante, ↵pquerna2005-08-271-1/+2
| | | | | | | | | making it match the non-debug version. Submitted By: Henry Jen <henryjen ztune.net> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@240370 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.c (apr_pool_cleanup_kill) [APR_POOL_DEBUG]:jorton2005-08-241-0/+9
| | | | | | | Add some cheap loop detection to abort if the cleanup list is corrupt. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@239666 13f79535-47bb-0310-9956-ffa450edef68
* Abort if the caller violates a joined-pool guarantee and explicitlyjorton2005-05-311-3/+21
| | | | | | | | | | | | | | | destroys a joined pool: (catches the mod_include pool lifetime issues described in PR 12655) * memory/unix/apr_pools.c (pool_destroy_debug): Renamed from apr_pool_destroy_debug; made static. (apr_pool_destroy_debug): New function, wrapper for pool_destroy_debug; abort if called on a joined pool. (pool_clear_debug): Use pool_destroy_debug rather than the wrapper to destroy subpools. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@179208 13f79535-47bb-0310-9956-ffa450edef68
* Steal the joined-pool debug code from 1.3:jorton2005-05-041-0/+16
| | | | | | | | | | | * include/apr_pools.h (apr_pool_is_ancestor): Note special semantics for joined pools. * memory/unix/apr_pools.c (apr_pool_join): Implement. (apr_pool_is_ancestor): Adjust for joined pools. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@168115 13f79535-47bb-0310-9956-ffa450edef68
* fix the style of the variable I added.pquerna2005-03-231-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@158849 13f79535-47bb-0310-9956-ffa450edef68
* Check the 'APR_POOL_DEBUG_LOG' for an alternative to stderr for debugging ↵pquerna2005-03-231-1/+14
| | | | | | pools. I found this very helpful when trying to debug things that detach from the tty, like httpd when not running with -DONE_PROCESS. If 'APR_POOL_DEBUG_LOG' is not set, the original behavoir of spewing out on stderr is maintained. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@158839 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.jerenkrantz2005-02-041-1/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Remove .cvsignore files.jorton2004-11-181-5/+0
| | | | | | | Tipped-of-by: Uwe Zeisberger git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@76269 13f79535-47bb-0310-9956-ffa450edef68
* WIN64: update pools code for 64 bit compilesake2004-10-071-9/+15
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65364 13f79535-47bb-0310-9956-ffa450edef68
* Reuse cleanup structures to prevent memory consumption from repeatedjorton2004-06-171-1/+14
| | | | | | | | | | | | | | | | | | | register/kill of a cleanup against a single pool: * memory/unix/apr_pools.c (struct apr_pool_t): Add freelist for cleanup structures. (apr_pool_cleanup_kill): Move used cleanup structures onto the freelist. (apr_pool_cleanup_register): Reuse cleanup structure if available. (apr_pool_clear, pool_clear_debug, apr_pool_create): Clear the freelist. * test/testpools.c (checker_cleanup, success_cleanup, test_cleanups): Add tests for cleanups. PR: 23567 (the easy half) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65206 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0jerenkrantz2004-02-131-49/+10
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* First whack at switching to a single top-level make. This adds a dependencygstein2004-02-051-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | upon Python at packaging time, but not at end-user config/build time. As far as I can tell, the build continues to function properly. (out-of-dir config/make not tested, and apr-iconv prolly needs some work) The buildconf scripts now generate a build-outputs.mk file which is included by the root's Makefile (via the build/gen-build.py script). bulid-outputs.mk specifies all of the various files present in the distribution. The top-level Makefiles were simplified to use an $(OBJECTS) symbol rather than 'find'ing them. Similarly, a $(HEADERS) symbol is used for the exports. The corresponding delete-* targets were eliminated since we have a precise set of inputs. The subdirs' Makefiles were removed since they are no longer called/used. The apr-util/uri Makefile was responsible for compiling a C program to generate the uri_delims.h file. That process was replaced by a Python script to generate the header (called by buildconf). The .c and .dsp were left for the Windows build to continue, but that should be revamped. build/apr_rules.mk was revamped somewhat to avoid recursion, but a lot of cleanup is still needed. Much of the recursive/local/x- logic is no longer needed and can be elimianated. rules.mk was created for inclusion by N makefiles, but that isn't really true any more, so it could probably be tossed (caveat: test/Makefile). Saved for a phase 2. Some additional work was added to properly clean up files in */build/, rather than relying on a makefile in there. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64891 13f79535-47bb-0310-9956-ffa450edef68
* Move the NetWare memory pool cleanup code outside of the APR_POOL_DEBUG #if ↵bnicholes2004-02-021-18/+23
| | | | | | | | | so that the clean up will happen regardless of the debugging mode. Submitted by: Jean-Jacques Clar [jjclar@novell.com] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64889 13f79535-47bb-0310-9956-ffa450edef68
* Since all NetWare memory is shared, allowing an application access to the ↵bnicholes2003-12-091-0/+7
| | | | | | APR global pool allows it to allocate memory and set cleanups that will never happen even if the application terminates. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64825 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.cstriker2003-11-061-0/+4
| | | | | | | | | (pool_clear_debug): When there is a child pool present after cleanups have been run, we know that a cleanup created a child pool. This results in orphaned pools, so in debug mode, abort(). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64735 13f79535-47bb-0310-9956-ffa450edef68
* Submitted by: Joe Ortonstriker2003-10-301-37/+26
| | | | | | | | | | | | Reviewed by: Greg Stein, Cliff Woolley, Sander Striker * memory/unix/apr_pools.c (list_insert, list_remove): new macros to do manipulation of lists throughout the pools code. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64701 13f79535-47bb-0310-9956-ffa450edef68
* apr_pools.c: In function `apr_pool_initialize':jwoolley2003-09-281-0/+1
| | | | | | | apr_pools.c:561: warning: implicit declaration of function `apr_atomic_init' git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64657 13f79535-47bb-0310-9956-ffa450edef68
* * misc/unix/start.cstriker2003-09-271-0/+14
| | | | | | | | | | | | | | | (apr_initialize): Remove atomics initialization from this function. Due to circular dependency, doing it here is too late. * memory/unix/apr_pools.c (apr_pool_initialize): Add atomics initialization to the release and debug versions. This has to happen here, since pools rely on mutexes, which can be backed by atomics. Atomics initialization requires a pool. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64655 13f79535-47bb-0310-9956-ffa450edef68
* axe these deprecated functions:trawick2003-09-031-57/+0
| | | | | | | | | | | | | | | | apr_allocator_get_mutex apr_allocator_get_owner apr_allocator_set_max_free apr_allocator_set_mutex apr_allocator_set_owner apr_pool_get_abort apr_pool_get_parent apr_pool_set_abort apr_pool_sub_make apr_signal_get_description git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64606 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.cstriker2003-07-181-1/+1
| | | | | | | | | | | (apr_pool_create_ex): Use the correct mutex when adding the pool to the pools parent child list. Submitted by: Brad Nicholes, Jean-Jacques Clar <jjclar@novell.com> Reviewed by: Cliff Woolley, Sander Striker git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64572 13f79535-47bb-0310-9956-ffa450edef68
* Fixed a bug that could be triggered remotely through mod_dav and possibly otherjerenkrantz2003-05-281-1/+1
| | | | | | | | | | | | | | mechanisms, causing an Apache child process to crash. The crash was first reported by David Endler <DEndler@iDefense.com> and was researched and fixed by Joe Orton <jorton@redhat.com>. Details will be released on 30 May 2003. CVE: CAN-2003-0245 Reported by: David Endler <DEndler@iDefense.com> Submitted by: Joe Orton <jorton@redhat.com> Reviewed by: Justin, Jim, Jeff git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64511 13f79535-47bb-0310-9956-ffa450edef68
* * memory/unix/apr_pools.cstriker2003-03-071-1/+4
| | | | | | | (apr_pool_check_integrity): Only log when being verbose. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64406 13f79535-47bb-0310-9956-ffa450edef68
* As near as I can tell, Win32 will now correspond to Unix in terms of thewrowe2003-02-271-21/+6
| | | | | | | availability and lifetime of the hproc process handle. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64388 13f79535-47bb-0310-9956-ffa450edef68