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 2201 - (download) (annotate)
Sun Feb 24 16:02:12 2013 UTC (7 years, 8 months ago) by lamonts
File size: 983 byte(s)
Refactored the spatail implementation slightly
//! \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) 
    {
        uint32_t newIdx = (queryPool->handle)++; 
        queryPool->pool[newIdx] = strandPtr; 
    }
    else 
    {
        // FIXME: You need to increase pool size if there's not enough space 
    }   
} 

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