/// <summary> /// Abre o armazenamento da memória mapeada. /// </summary> /// <param name="fileName"></param> /// <param name="viewCount"></param> /// <param name="viewSize"></param> /// <param name="initialSizeMB"></param> public void OpenMemoryMappedStore(string fileName, uint viewCount, uint viewSize, uint initialSizeMB) { try { _fileName = fileName; _viewCount = viewCount; _viewSize = SysUtil.AllignViewSize(viewSize); _initialSizeMB = initialSizeMB; _mmf = MmfFile.Create(_fileName, (ulong)(_initialSizeMB * 0x100000), false); _viewManager = new ViewManager(_mmf, _viewSize); _viewManager.CreateInitialViews(_viewCount); } catch (Exception) { throw; } }
/// <summary> /// Maps the file to the memory of the process. /// </summary> public void OpenMemoryMappedStore(string fileName, uint viewCount, uint viewSize, uint initialSizeMB) { try { _fileName = fileName; _viewCount = viewCount; _viewSize = (uint)SysUtil.AllignViewSize(viewSize); _initialSizeMB = initialSizeMB; _mmf = MmfFile.Create(_fileName, _initialSizeMB * StorageProviderBase.MB, false); _viewManager = new ViewManager(_mmf, _viewSize); _viewManager.CreateInitialViews(_viewCount); } catch (Exception e) { //Console.WriteLine("MmfStorage.OpenMemoryMappedStore" + "Error:" + e); throw; } }