int32 _Calculate_CurrentNbaMemoryAllocationInfo ( int32 flag ) { dlnode * node, * nextNode ; NamedByteArray * nba ; _Q_->MemRemaining = 0 ; _Q_->TotalAccountedMemAllocated = 0 ; if ( _Q_ && _Q_->MemorySpace0 ) { for ( node = dllist_First ( (dllist*) &_Q_->MemorySpace0->NBAs ) ; node ; node = nextNode ) { nextNode = dlnode_Next ( node ) ; nba = Get_NBA_Node_To_NBA ( node ) ; if ( flag ) NBA_Show ( nba, 0 ) ; _Q_->TotalAccountedMemAllocated += nba->TotalAllocSize ; _Q_->MemRemaining += nba->MemRemaining ; } int32 diff = _Q_->Mmap_TotalMemoryAllocated - _Q_->TotalAccountedMemAllocated ; if ( flag && diff ) { printf ( "\n_Q_->Mmap_TotalMemoryAllocated = %9d : _Q_->TotalAccountedMemAllocated = %9d :: diff = %6d\n", _Q_->Mmap_TotalMemoryAllocated, _Q_->TotalAccountedMemAllocated, diff ) ; fflush ( stdout ) ; } } return _Q_->TotalAccountedMemAllocated ; }
void OVT_ShowNBAs ( ) { if ( _Q_ ) { dlnode * node, *nodeNext ; if ( _Q_->MemorySpace0 && ( node = dllist_First ( (dllist*) &_Q_->MemorySpace0->NBAs ) ) ) { for ( ; node ; node = nodeNext ) { nodeNext = dlnode_Next ( node ) ; NamedByteArray * nba = Get_NBA_Symbol_To_NBA ( node ) ; NBA_Show ( nba, 1 ) ; } } printf ( "\n" ) ; fflush ( stdout ) ; } }
void Calculate_CurrentMemoryAllocationInfo ( ) { DLNode * node, * nextNode ; NamedByteArray * nba ; _Q_->MemAllocated = 0 ; _Q_->MemRemaining = 0 ; _Q_->NumberOfByteArrays = 0 ; if ( _Q_ && _Q_->MemorySpace0 ) { for ( node = DLList_First ( _Q_->MemorySpace0->NBAs ) ; node ; node = nextNode ) { nextNode = DLNode_Next ( node ) ; nba = (NamedByteArray*) node ; NBA_Show ( nba ) ; _Q_->MemAllocated += nba->MemAllocated ; _Q_->MemRemaining += nba->MemRemaining ; _Q_->NumberOfByteArrays += nba->NumberOfByteArrays ; } } _Q_->MemAllocated += ( _Q_->NumberOfByteArrays * sizeof (ByteArray) ) ; //int32 plistTotal = _MemList_GetCurrentMemAllocated ( _Q_->PermanentMemList, 0 ) ; _Q_->MemAllocated += _MemList_GetCurrentMemAllocated ( _Q_->PermanentMemList, 0 ) ; }