示例#1
0
void
MM_TLHAllocationSupport::setupTLH(MM_EnvironmentBase *env, void *addrBase, void *addrTop, MM_MemorySubSpace *memorySubSpace, MM_MemoryPool *memoryPool)
{
	MM_GCExtensionsBase *extensions = env->getExtensions();

	if (extensions->doFrequentObjectAllocationSampling){
		updateFrequentObjectsStats(env);
	}

	/* Set the new TLH values */
	setBase(addrBase);
	setAlloc(addrBase);
	setTop(addrTop);
	if (NULL != memorySubSpace) {
		setObjectFlags(memorySubSpace->getObjectFlags());
	}
	setMemoryPool(memoryPool);
	setMemorySubSpace(memorySubSpace);
#if defined(OMR_GC_TLH_PREFETCH_FTA)
	*_pointerToTlhPrefetchFTA = 0;
#endif /* OMR_GC_TLH_PREFETCH_FTA */
}
示例#2
0
/*
*******************************************************************
* Function:   
*
* Description: 
*    
* Parameters: 
*
* Returns: 
*
*******************************************************************
*/
void xDistributedSession::unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream)
{

	xNetInterface *netInterface  = (xNetInterface*) connection->getInterface();
	if (netInterface)
	{
		//////////////////////////////////////////////////////////////////////////
		//initial update  ? 
		if(stream->readFlag())
		{
			if(stream->readFlag())
			{
				char oName[256];stream->readString(oName);	// retrieve objects name : 
				char cName[256];stream->readString(cName);	// retrieve objects dist class name : 
				int type  = stream->readInt(32);							//read the dist class base type : 
				int userID = stream->readInt(32);	
				int serverID2 = stream->readInt(32);	
				float creationTime = 0.0f;
				stream->read(&creationTime);
				int sessionID = stream->readInt(32);	
				int MaxUsers = stream->readInt(32);	
				char pass[256];stream->readString(pass);





				//////////////////////////////////////////////////////////////////////////
				//now we store all in the dist object :

				//find and store the dist class : 
				xDistributedClassesArrayType *_classes = netInterface->getDistributedClassInterface()->getDistrutedClassesPtr();
				xDistributedClass *classTemplate = netInterface->getDistributedClassInterface()->get(cName,type);
				if (!classTemplate)
				{
					xLogger::xLog(ELOGERROR,E_LI_SESSION,"Warning initial unpack of session %s failed :  no related class found  : %s",oName,cName);
					//xLogger::xLog(ELOGINFO,XL_START,"Warning Initial Unpack Update, no related class found  : %s",cName);
					//xLogger::xLog(ELOGERROR,XL_SESSION,"Warning Initial Unpack Update, no related class found  : %s",cName);
					classTemplate  = netInterface->getDistributedClassInterface()->createClass(cName,type);

				}
				setDistributedClass(classTemplate);
				SetName(oName);
				setServerID(connection->getGhostIndex(this));
				setObjectFlags(E_DO_CREATION_CREATED);
				setUserID(userID);
				setNetInterface(netInterface);
				setCreationTime(creationTime);
				setSessionID(sessionID);
                			
				
				getOwnershipState().set( 1<<E_DO_OS_OWNER,  getUserID() == ((vtConnection*)connection)->getUserID() );

				setInterfaceFlags(E_DO_CREATED);
				getSessionFlags().set( 1 << E_SF_INCOMPLETE );


				xLogger::xLog(ELOGTRACE,E_LI_SESSION,"Retrieved initial state of session %s",oName);
				initProperties();
				setMaxUsers(MaxUsers);
				setPassword(xNString(pass));
				vtConnection *con  = (vtConnection*)connection;
				setOwnerConnection(con);
			}
		}



		int updateBits = stream->readSignedInt(32);
		TNL::BitSet32 updateBitsMask(updateBits);
		setGhostUpdateBits(updateBits);

		xDistributedPropertyArrayType &props = *getDistributedPorperties();
		int propCounter = 0;
		for (unsigned int i = 0  ;  i < props.size() ; i++ )
		{
			xDistributedProperty *prop  = props[i];
			xDistributedPropertyInfo*propInfo  = prop->getPropertyInfo();
			int blockIndex = prop->getBlockIndex();
			if (updateBitsMask.testStrict(1<<blockIndex))
			{
				prop->updateFromServer(stream);
				xLogger::xLog(ELOGTRACE,E_LI_SESSION,"Client : retrieving session property : %s |pred :%d",prop->getPropertyInfo()->mName.getString(),prop->getPropertyInfo()->mPredictionType);
				//xLogger::xLog(ELOGINFO,XL_START,"client : retrieving session property : %s",prop->getPropertyInfo()->mName.getString());
				getSessionFlags().set( 1 << E_SF_COMPLETE );
				propCounter++;
			}
		}

		if (propCounter == props.size())
		{
			getSessionFlags().set( 1 << E_SF_COMPLETE );
		}
	}
}