Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/bind9/isc
File: pool.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
#ifndef ISC_OBJPOOL_H
[11] Fix | Delete
#define ISC_OBJPOOL_H 1
[12] Fix | Delete
[13] Fix | Delete
/*****
[14] Fix | Delete
***** Module Info
[15] Fix | Delete
*****/
[16] Fix | Delete
[17] Fix | Delete
/*! \file isc/pool.h
[18] Fix | Delete
* \brief An object pool is a mechanism for sharing a small pool of
[19] Fix | Delete
* fungible objects among a large number of objects that depend on them.
[20] Fix | Delete
*
[21] Fix | Delete
* This is useful, for example, when it causes performance problems for
[22] Fix | Delete
* large number of zones to share a single memory context or task object,
[23] Fix | Delete
* but it would create a different set of problems for them each to have an
[24] Fix | Delete
* independent task or memory context.
[25] Fix | Delete
*/
[26] Fix | Delete
[27] Fix | Delete
[28] Fix | Delete
/***
[29] Fix | Delete
*** Imports.
[30] Fix | Delete
***/
[31] Fix | Delete
[32] Fix | Delete
#include <isc/lang.h>
[33] Fix | Delete
#include <isc/mem.h>
[34] Fix | Delete
#include <isc/types.h>
[35] Fix | Delete
[36] Fix | Delete
ISC_LANG_BEGINDECLS
[37] Fix | Delete
[38] Fix | Delete
/*****
[39] Fix | Delete
***** Types.
[40] Fix | Delete
*****/
[41] Fix | Delete
[42] Fix | Delete
typedef void
[43] Fix | Delete
(*isc_pooldeallocator_t)(void **object);
[44] Fix | Delete
[45] Fix | Delete
typedef isc_result_t
[46] Fix | Delete
(*isc_poolinitializer_t)(void **target, void *arg);
[47] Fix | Delete
[48] Fix | Delete
typedef struct isc_pool isc_pool_t;
[49] Fix | Delete
[50] Fix | Delete
/*****
[51] Fix | Delete
***** Functions.
[52] Fix | Delete
*****/
[53] Fix | Delete
[54] Fix | Delete
isc_result_t
[55] Fix | Delete
isc_pool_create(isc_mem_t *mctx, unsigned int count,
[56] Fix | Delete
isc_pooldeallocator_t free,
[57] Fix | Delete
isc_poolinitializer_t init, void *initarg,
[58] Fix | Delete
isc_pool_t **poolp);
[59] Fix | Delete
/*%<
[60] Fix | Delete
* Create a pool of "count" object pointers. If 'free' is not NULL,
[61] Fix | Delete
* it points to a function that will detach the objects. 'init'
[62] Fix | Delete
* points to a function that will initialize the arguments, and
[63] Fix | Delete
* 'arg' to an argument to be passed into that function (for example,
[64] Fix | Delete
* a relevant manager or context object).
[65] Fix | Delete
*
[66] Fix | Delete
* Requires:
[67] Fix | Delete
*
[68] Fix | Delete
*\li 'mctx' is a valid memory context.
[69] Fix | Delete
*
[70] Fix | Delete
*\li init != NULL
[71] Fix | Delete
*
[72] Fix | Delete
*\li poolp != NULL && *poolp == NULL
[73] Fix | Delete
*
[74] Fix | Delete
* Ensures:
[75] Fix | Delete
*
[76] Fix | Delete
*\li On success, '*poolp' points to the new object pool.
[77] Fix | Delete
*
[78] Fix | Delete
* Returns:
[79] Fix | Delete
*
[80] Fix | Delete
*\li #ISC_R_SUCCESS
[81] Fix | Delete
*\li #ISC_R_NOMEMORY
[82] Fix | Delete
*\li #ISC_R_UNEXPECTED
[83] Fix | Delete
*/
[84] Fix | Delete
[85] Fix | Delete
void *
[86] Fix | Delete
isc_pool_get(isc_pool_t *pool);
[87] Fix | Delete
/*%<
[88] Fix | Delete
* Returns a pointer to an object from the pool. Currently the object
[89] Fix | Delete
* is chosen from the pool at random. (This may be changed in the future
[90] Fix | Delete
* to something that guaratees balance.)
[91] Fix | Delete
*/
[92] Fix | Delete
[93] Fix | Delete
int
[94] Fix | Delete
isc_pool_count(isc_pool_t *pool);
[95] Fix | Delete
/*%<
[96] Fix | Delete
* Returns the number of objcts in the pool 'pool'.
[97] Fix | Delete
*/
[98] Fix | Delete
[99] Fix | Delete
isc_result_t
[100] Fix | Delete
isc_pool_expand(isc_pool_t **sourcep, unsigned int count, isc_pool_t **targetp);
[101] Fix | Delete
[102] Fix | Delete
/*%<
[103] Fix | Delete
* If 'size' is larger than the number of objects in the pool pointed to by
[104] Fix | Delete
* 'sourcep', then a new pool of size 'count' is allocated, the existing
[105] Fix | Delete
* objects are copied into it, additional ones created to bring the
[106] Fix | Delete
* total number up to 'count', and the resulting pool is attached to
[107] Fix | Delete
* 'targetp'.
[108] Fix | Delete
*
[109] Fix | Delete
* If 'count' is less than or equal to the number of objects in 'source', then
[110] Fix | Delete
* 'sourcep' is attached to 'targetp' without any other action being taken.
[111] Fix | Delete
*
[112] Fix | Delete
* In either case, 'sourcep' is detached.
[113] Fix | Delete
*
[114] Fix | Delete
* Requires:
[115] Fix | Delete
*
[116] Fix | Delete
* \li 'sourcep' is not NULL and '*source' is not NULL
[117] Fix | Delete
* \li 'targetp' is not NULL and '*source' is NULL
[118] Fix | Delete
*
[119] Fix | Delete
* Ensures:
[120] Fix | Delete
*
[121] Fix | Delete
* \li On success, '*targetp' points to a valid task pool.
[122] Fix | Delete
* \li On success, '*sourcep' points to NULL.
[123] Fix | Delete
*
[124] Fix | Delete
* Returns:
[125] Fix | Delete
*
[126] Fix | Delete
* \li #ISC_R_SUCCESS
[127] Fix | Delete
* \li #ISC_R_NOMEMORY
[128] Fix | Delete
*/
[129] Fix | Delete
[130] Fix | Delete
void
[131] Fix | Delete
isc_pool_destroy(isc_pool_t **poolp);
[132] Fix | Delete
/*%<
[133] Fix | Delete
* Destroy a task pool. The tasks in the pool are detached but not
[134] Fix | Delete
* shut down.
[135] Fix | Delete
*
[136] Fix | Delete
* Requires:
[137] Fix | Delete
* \li '*poolp' is a valid task pool.
[138] Fix | Delete
*/
[139] Fix | Delete
[140] Fix | Delete
ISC_LANG_ENDDECLS
[141] Fix | Delete
[142] Fix | Delete
#endif /* ISC_OBJPOOL_H */
[143] Fix | Delete
[144] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function