Interface MemoryAllocator<T extends Memory>

    • Method Detail

      • allocate

        T allocate​(int size)
        Allocates memory.
        Parameters:
        size - The count of the memory to allocate.
        Returns:
        The allocated memory.
      • reallocate

        T reallocate​(T memory,
                     int size)
        Reallocates the given memory.

        When the memory is reallocated, the memory address for the given Memory instance may change. The returned Memory instance will contain the updated address and count.

        Parameters:
        memory - The memory to reallocate.
        size - The count to which to reallocate the given memory.
        Returns:
        The reallocated memory.