summaryrefslogtreecommitdiff
path: root/include/apr_allocator.h
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-05-15 10:26:47 +0000
committerStefan Fritsch <sf@apache.org>2011-05-15 10:26:47 +0000
commit55550d8a25efc9234715ac10c01ba875e40bb76a (patch)
treee33525f3b7359c56c22fc00f55ba3d58557ea6c8 /include/apr_allocator.h
parentfe9f0052bbc1fc49df3402b3c55402ec77d2a750 (diff)
downloadapr-55550d8a25efc9234715ac10c01ba875e40bb76a.tar.gz
Add some nonnull and pure attributes
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1103310 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_allocator.h')
-rw-r--r--include/apr_allocator.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/include/apr_allocator.h b/include/apr_allocator.h
index 5aaeb1b2f..5d6677645 100644
--- a/include/apr_allocator.h
+++ b/include/apr_allocator.h
@@ -71,7 +71,8 @@ struct apr_memnode_t {
* @param allocator The allocator we have just created.
*
*/
-APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
+APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)
+ __attribute__((nonnull(1)));
/**
* Destroy an allocator
@@ -79,7 +80,8 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator);
* @remark Any memnodes not given back to the allocator prior to destroying
* will _not_ be free()d.
*/
-APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
+APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
+ __attribute__((nonnull(1)));
/**
* Allocate a block of mem from the allocator
@@ -88,7 +90,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator);
* memnode structure)
*/
APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
- apr_size_t size);
+ apr_size_t size)
+ __attribute__((nonnull(1)));
/**
* Free a list of blocks of mem, giving them back to the allocator.
@@ -98,7 +101,8 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
* @param memnode The memory node to return
*/
APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
- apr_memnode_t *memnode);
+ apr_memnode_t *memnode)
+ __attribute__((nonnull(1,2)));
#include "apr_pools.h"
@@ -114,13 +118,15 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
* the allocator will never be destroyed.
*/
APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
- apr_pool_t *pool);
+ apr_pool_t *pool)
+ __attribute__((nonnull(1)));
/**
* Get the current owner of the allocator
* @param allocator The allocator to get the owner from
*/
-APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
+APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
+ __attribute__((nonnull(1)));
/**
* Set the current threshold at which the allocator should start
@@ -129,7 +135,8 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator);
* @param size The threshold. 0 == unlimited.
*/
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
- apr_size_t size);
+ apr_size_t size)
+ __attribute__((nonnull(1)));
#include "apr_thread_mutex.h"
@@ -140,14 +147,16 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
* @param mutex The mutex
*/
APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
- apr_thread_mutex_t *mutex);
+ apr_thread_mutex_t *mutex)
+ __attribute__((nonnull(1)));
/**
* Get the mutex currently set for the allocator
* @param allocator The allocator
*/
APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
- apr_allocator_t *allocator);
+ apr_allocator_t *allocator)
+ __attribute__((nonnull(1)));
#endif /* APR_HAS_THREADS */