Example #1
0
 /// <summary>
 /// Recupera a <see cref="MemArea"/> associado com os dados armazenados na <see cref="MemArea"/> informada.
 /// </summary>
 /// <param name="areaCopy"><see cref="MemArea"/> com os dados do item de armazenamento.</param>
 /// <returns></returns>
 internal static MemArea GetActualArea(MemArea areaCopy)
 {
     if (areaCopy == null)
     {
         return(null);
     }
     if (!areaCopy.IsFree)
     {
         StoreItem item = StoreItem.FromBinary(areaCopy.GetMemContents(), areaCopy.View.ParentStorageProvider.CacheContext);
         return(areaCopy.View.ParentStorageProvider.GetMemArea(item.Key));
     }
     return(areaCopy);
 }
Example #2
0
 /// <summary>
 /// Gets the primary allocated arena for the arena provided. Checks key and then  gets the original one.
 /// </summary>
 // To keep the HashTable synch with the MemArena changes, we need to apply changes  to only those objects that
 // are allocated primarily to be added into hash-table. This function returns the original allocated MemArena against a key
 // so that at time of MemArena updates _itemDict-->MmfObjectPtr-->MemArena is the one to be updated
 internal static MemArena GetActualArena(MemArena arenaCopy)
 {
     if (arenaCopy != null)
     {
         if (!arenaCopy.IsFree)
         {
             byte[]    data    = arenaCopy.GetMemContents();
             StoreItem item    = StoreItem.FromBinary(data, arenaCopy.View.ParentStorageProvider.CacheContext);
             MemArena  arenAct = arenaCopy.View.ParentStorageProvider.GetMemArena(item.Key);
             return(arenAct);
         }
         else
         {
             return(arenaCopy);
         }
     }
     return(null);
 }