public MemoryCollection(MemoryContext context) { this.count = 0; this.allocation = new Size(0); this.synchronizer = new object(); this.context = context; this.items = new SortedDictionary <int, ConcurrentQueue <byte[]> >(); if (context.Configuration.Thresholds != null) { foreach (int threshold in context.Configuration.Thresholds) { items.Add(threshold, new ConcurrentQueue <byte[]>()); } } if (items.ContainsKey(context.Configuration.MaxBlockSize) == false) { items.Add(context.Configuration.MaxBlockSize, new ConcurrentQueue <byte[]>()); } }
public MemoryService(MemoryParameters parameters, MemoryDependencies dependencies, MemoryConfiguration configuration, MemoryHooks hooks) { context = new MemoryContext(parameters, dependencies, configuration, hooks); }