Example #1
0
        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[]>());
            }
        }
Example #2
0
 public MemoryService(MemoryParameters parameters, MemoryDependencies dependencies, MemoryConfiguration configuration, MemoryHooks hooks)
 {
     context = new MemoryContext(parameters, dependencies, configuration, hooks);
 }