qAutoStereo_20190430/qas/src/main/cpp/btk/b_BasicEm/Context.c
/** adds a static memory segment to memory table of context */
adds a static memory segment to memory table of context
adds a static memory segment to memory table of context
void bbs_Context_addStaticSeg(	struct bbs_Context* cpA,
							    uint16* memPtrA, 
								uint32 sizeA,    
								flag sharedA,    
								uint32 idA )     
{
	struct bbs_MemSeg memSegL;
	bbs_DEF_fNameL( "void bbs_Context_addStaticSeg(....)" )
	if( sharedA && cpA->memTblE.ssSizeE == bbs_MAX_MEM_SEGS )
	{
		bbs_ERROR1( "%s:\nShared Memory Table is full! Increase bbs_MAX_MEM_SEGS", fNameL );
		return;
	}
	if( sharedA && cpA->memTblE.esSizeE == bbs_MAX_MEM_SEGS )
	{
		bbs_ERROR1( "%s:\nExclusive Memory Table is full! Increase bbs_MAX_MEM_SEGS", fNameL );
		return;
	}
	bbs_MemSeg_init( cpA, &memSegL );
	memSegL.memPtrE = memPtrA;
	memSegL.sizeE = sizeA;
	memSegL.allocIndexE = 0;
	memSegL.sharedE = sharedA;
	memSegL.idE = idA;
	memSegL.dynMemManagerPtrE = NULL;
	if( sharedA )
	{
		cpA->memTblE.ssArrE[ cpA->memTblE.ssSizeE++ ] = memSegL;
	}
	else
	{
		cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ] = memSegL;
		cpA->memTblE.espArrE[ cpA->memTblE.esSizeE ] = &cpA->memTblE.esArrE[ cpA->memTblE.esSizeE ];
		cpA->memTblE.esSizeE++;
	}
}
void bbs_Context_addStaticSeg ( struct bbs_Context * cpA , uint16 * memPtrA , uint32 sizeA , flag sharedA , uint32 idA ) { struct bbs_MemSeg memSegL ; bbs_DEF_fNameL ( " " ) if ( sharedA && cpA -> memTblE . ssSizeE == bbs_MAX_MEM_SEGS ) { bbs_ERROR1 ( " \n " , fNameL ) ; return ; } if ( sharedA && cpA -> memTblE . esSizeE == bbs_MAX_MEM_SEGS ) { bbs_ERROR1 ( " \n " , fNameL ) ; return ; } bbs_MemSeg_init ( cpA , & memSegL ) ; memSegL . memPtrE = memPtrA ; memSegL . sizeE = sizeA ; memSegL . allocIndexE = 0 ; memSegL . sharedE = sharedA ; memSegL . idE = idA ; memSegL . dynMemManagerPtrE = NULL ; if ( sharedA ) { cpA -> memTblE . ssArrE [ cpA -> memTblE . ssSizeE ++ ] = memSegL ; } else { cpA -> memTblE . esArrE [ cpA -> memTblE . esSizeE ] = memSegL ; cpA -> memTblE . espArrE [ cpA -> memTblE . esSizeE ] = & cpA -> memTblE . esArrE [ cpA -> memTblE . esSizeE ] ; cpA -> memTblE . esSizeE ++ ; } }
adds a static memory segment to memory table of context
adds a static memory segment to memory table of context
/* pointer to memory */ /* size of memory segment in 16 bit units */ /* Indicates that this segment is to be shared among multiple objects */ /* ID of segment, id=0: unspecified */ /* checks */