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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2201 - (view) (download)

1 : lamonts 2201 //! \brief allocate memory for the query pool
2 :     //! \return the query pool structure
3 :     QueryPool_t * Diderot_QueryAllocPool()
4 :     {
5 :     QueryPool_t * newQueryPool = CheckedAlloc (sizeof(QueryPool_t));
6 :    
7 :     newQueryPool->size = QUERY_POOL_SIZE;
8 :     newQueryPool->handle = 0;
9 :     newQueryPool->pool = (@STRANDTY@ **)CheckedAlloc(sizeof(@STRANDTY@ *)*QUERY_POOL_SIZE);
10 :    
11 :     return newQueryPool;
12 :     }
13 :     //! \brief allocate memory for the query pool
14 :     //! \return the query pool structure
15 :     void Diderot_QueryClearPool(QueryPool_t * queryPool)
16 :     {
17 :     queryPool->handle = 0;
18 :     }
19 :     //! \brief allocate memory for the query pool
20 :     //! \return the query pool structure
21 :     void Diderot_QueryAddToPool(@STRANDTY@ * strandPtr, QueryPool_t * queryPool)
22 :     {
23 :     if(queryPool->handle < queryPool->size)
24 :     {
25 :     uint32_t newIdx = (queryPool->handle)++;
26 :     queryPool->pool[newIdx] = strandPtr;
27 :     }
28 :     else
29 :     {
30 :     // FIXME: You need to increase pool size if there's not enough space
31 :     }
32 :     }

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