| 1 |
/** BEGIN COPYRIGHT BLOCK |
| 2 |
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. |
| 3 |
* Copyright (C) 2005 Red Hat, Inc. |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* License: GPL (version 3 or any later version). |
| 7 |
* See LICENSE for details. |
| 8 |
* END COPYRIGHT BLOCK **/ |
| 9 |
|
| 10 |
#ifdef HAVE_CONFIG_H |
| 11 |
#include <config.h> |
| 12 |
#endif |
| 13 |
|
| 14 |
#ifndef BASE_POOL_H |
| 15 |
#define BASE_POOL_H |
| 16 |
|
| 17 |
#ifndef NOINTNSAPI |
| 18 |
#define INTNSAPI |
| 19 |
#endif /* !NOINTNSAPI */ |
| 20 |
|
| 21 |
/* |
| 22 |
* pool.h |
| 23 |
* |
| 24 |
* Module for handling memory allocations. |
| 25 |
* |
| 26 |
* Notes: |
| 27 |
* This module is used instead of the NSPR prarena module because the prarenas |
| 28 |
* did not fit as cleanly into the existing server. |
| 29 |
* |
| 30 |
* Mike Belshe |
| 31 |
* 10-02-95 |
| 32 |
* |
| 33 |
*/ |
| 34 |
|
| 35 |
#ifdef MALLOC_POOLS |
| 36 |
|
| 37 |
#ifndef NETSITE_H |
| 38 |
#include "netsite.h" |
| 39 |
#endif /* !NETSITE_H */ |
| 40 |
|
| 41 |
/* --- Begin function prototypes --- */ |
| 42 |
|
| 43 |
#ifdef INTNSAPI |
| 44 |
|
| 45 |
NSPR_BEGIN_EXTERN_C |
| 46 |
|
| 47 |
int pool_internal_init(void); |
| 48 |
|
| 49 |
#ifdef DEBUG_CACHES |
| 50 |
NSAPI_PUBLIC int INTpool_service_debug(pblock *pb, Session *sn, Request *rq); |
| 51 |
#endif |
| 52 |
|
| 53 |
NSAPI_PUBLIC pool_handle_t *INTpool_create(void); |
| 54 |
NSAPI_PUBLIC void INTpool_terminate(void); |
| 55 |
|
| 56 |
NSAPI_PUBLIC void INTpool_destroy(pool_handle_t *pool_handle); |
| 57 |
|
| 58 |
NSAPI_PUBLIC int INTpool_enabled(void); |
| 59 |
|
| 60 |
NSAPI_PUBLIC void *INTpool_malloc(pool_handle_t *pool_handle, size_t size); |
| 61 |
|
| 62 |
NSAPI_PUBLIC void INTpool_free(pool_handle_t *pool_handle, void *ptr); |
| 63 |
|
| 64 |
NSAPI_PUBLIC void *INTpool_calloc(pool_handle_t *pool_handle, size_t nelem, size_t elsize); |
| 65 |
|
| 66 |
NSAPI_PUBLIC |
| 67 |
void *INTpool_realloc(pool_handle_t *pool_handle, void *ptr, size_t size); |
| 68 |
|
| 69 |
NSAPI_PUBLIC |
| 70 |
char *INTpool_strdup(pool_handle_t *pool_handle, const char *orig_str); |
| 71 |
|
| 72 |
NSPR_END_EXTERN_C |
| 73 |
|
| 74 |
#ifdef DEBUG_CACHES |
| 75 |
#define pool_service_debug INTpool_service_debug |
| 76 |
#endif /* DEBUG_CACHES */ |
| 77 |
|
| 78 |
#define pool_create INTpool_create |
| 79 |
#define pool_terminate INTpool_terminate |
| 80 |
#define pool_destroy INTpool_destroy |
| 81 |
#define pool_enabled INTpool_enabled |
| 82 |
#define pool_malloc INTpool_malloc |
| 83 |
#define pool_free INTpool_free |
| 84 |
#define pool_calloc INTpool_calloc |
| 85 |
#define pool_realloc INTpool_realloc |
| 86 |
#define pool_strdup INTpool_strdup |
| 87 |
|
| 88 |
#endif /* INTNSAPI */ |
| 89 |
|
| 90 |
#endif /* MALLOC_POOLS */ |
| 91 |
|
| 92 |
#endif /* !BASE_POOL_H_ */ |