Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/src/compiler/c-target/fragments/queryPool.in
ViewVC logotype

View of /branches/lamont/src/compiler/c-target/fragments/queryPool.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2202 - (download) (annotate)
Sun Feb 24 17:22:25 2013 UTC (7 years, 9 months ago) by lamonts
File size: 1040 byte(s)
Added Reallocated to Query Pool
//! \brief allocate memory for the query pool
//! \return the query pool structure 
QueryPool_t * Diderot_QueryAllocPool() 
{
	QueryPool_t * newQueryPool = CheckedAlloc (sizeof(QueryPool_t));

    newQueryPool->size = QUERY_POOL_SIZE; 
    newQueryPool->handle = 0; 
    newQueryPool->pool = (@STRANDTY@ **)CheckedAlloc(sizeof(@STRANDTY@ *)*QUERY_POOL_SIZE); 

    return newQueryPool; 
}
//! \brief allocate memory for the query pool
//! \return the query pool structure 
void Diderot_QueryClearPool(QueryPool_t * queryPool)
{ 
    queryPool->handle = 0; 
} 
//! \brief allocate memory for the query pool
//! \return the query pool structure 
void Diderot_QueryAddToPool(@STRANDTY@ * strandPtr, QueryPool_t * queryPool)
{ 
    if(queryPool->handle >= queryPool->size) 
    {
        queryPool->pool = CheckedReAlloc(queryPool->pool,sizeof(@STRANDTY@ *)* (QUERY_POOL_SIZE  + queryPool->size)); 
        queryPool->size += QUERY_POOL_SIZE; 
    }   
    uint32_t newIdx = (queryPool->handle)++; 
    queryPool->pool[newIdx] = strandPtr; 
} 

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0