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/seq-new.in
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2298 - (download) (annotate)
Fri Mar 15 22:18:22 2013 UTC (6 years, 8 months ago) by jhr
File size: 1066 byte(s)
  Merging in changes from vis12 branch.
//! add an allocated new strand to the world 
uint32_t  @STRAND@_AllocNewStrand (@PREFIX@World_t *wrld) 
{
    StrandPoolInfo_t *poolInfo = &wrld->poolInfo;
    if (poolInfo->handle == poolInfo->size)  {
	uint32_t newSize = poolInfo->size + STRAND_POOL_INC_SIZE;
#ifdef DIDEROT_DUAL_STATE
	wrld->inState = (@STRANDTY@ **)CheckedReAlloc(wrld->inState, newSize * sizeof(@STRANDTY@ *));
	wrld->outState = (@STRANDTY@ **)CheckedReAlloc(wrld->outState, newSize * sizeof(@STRANDTY@ *));
#else
	wrld->state = (@STRANDTY@ *)CheckedReAlloc(wrld->state, newSize * sizeof(@STRANDTY@));
#endif
        wrld->status = (uint8_t *)CheckedReAlloc(wrld->status, newSize * sizeof(uint8_t)); 
        poolInfo->size = newSize; 

        for (uint32_t i = poolInfo->handle; i < poolInfo->size; i++) {
#ifdef DIDEROT_DUAL_STATE
            wrld->inState[i] = NEW(@STRANDTY@);
            wrld->outState[i] = NEW(@STRANDTY@);
#endif
            wrld->status[i] = DIDEROT_ACTIVE;
        }
    } 

    uint32_t newIdx = poolInfo->handle++;
    poolInfo->nNewStrand++;
    return newIdx;
}

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