Main Page | Modules | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

pool_cap.c File Reference


Detailed Description

Pool-capacity functions.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hypool.h"

Functions

UDATA VMCALL pool_ensureCapacity (HyPool *aPool, UDATA newCapacity)
 Ensures that the pool is large enough for newCapacity elements.
UDATA VMCALL pool_capacity (HyPool *aPool)
 Returns the total capacity of a pool.


Function Documentation

UDATA VMCALL pool_capacity HyPool *  aPool  ) 
 

Returns the total capacity of a pool.

Parameters:
[in] aPool The pool
Returns:
0 on error

numElements in aPool otherwise

UDATA VMCALL pool_ensureCapacity HyPool *  aPool,
UDATA  newCapacity
 

Ensures that the pool is large enough for newCapacity elements.

This has the side effect of setting the POOL_NEVER_FREE_PUDDLES flag. Without this, the pool could shrink back down to its original size. Note that this does not take into account the number of elements already used in the pool.

Parameters:
[in] aPool The pool
[in] newCapacity The desired new-size of the pool
Returns:
0 on success

-1 on failure


(c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable.