Class DefaultAllocator

    • Constructor Detail

      • DefaultAllocator

        public DefaultAllocator​(boolean trimOnReset,
                                int individualAllocationSize)
        Constructs an instance without creating any Allocations up front.
        Parameters:
        trimOnReset - Whether memory is freed when the allocator is reset. Should be true unless the allocator will be re-used by multiple player instances.
        individualAllocationSize - The length of each individual Allocation.
      • DefaultAllocator

        public DefaultAllocator​(boolean trimOnReset,
                                int individualAllocationSize,
                                int initialAllocationCount)
        Constructs an instance with some Allocations created up front.

        Note: Allocations created up front will never be discarded by trim().

        Parameters:
        trimOnReset - Whether memory is freed when the allocator is reset. Should be true unless the allocator will be re-used by multiple player instances.
        individualAllocationSize - The length of each individual Allocation.
        initialAllocationCount - The number of allocations to create up front.