Beispiel #1
0
        protected void CreateObjects(int count)
        {
            if (count == 0)
            {
                return;
            }

            for (var i = 0; i < count; i++)
            {
                storage.Return(New());
            }
        }
Beispiel #2
0
        private void Allocate()
        {
            if (storage.Count != 0)
            {
                return;
            }

            var i = 0;

            while (i < allocations)
            {
                storage.Return(instantiate());

                i++;
            }
        }