Class MemoryLimits


  • public final class MemoryLimits
    extends Object
    Limits for memory sizes, in pages. Memory limits also define whether the corresponding memory is shared.

    See Limits and Memories for reference. See also Overview for the history of shared memory.

    • Field Detail

      • MAX_PAGES

        public static final int MAX_PAGES
        Maximum allowed number of pages.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MemoryLimits

        public MemoryLimits​(int initial)
        Construct a new instance. The maximum size will be MAX_PAGES and shared will be false.
        Parameters:
        initial - the initial size
      • MemoryLimits

        public MemoryLimits​(int initial,
                            int maximum)
        Construct a new instance. shared will be false.
        Parameters:
        initial - the initial size
        maximum - the maximum size, in pages
      • MemoryLimits

        public MemoryLimits​(int initial,
                            int maximum,
                            boolean shared)
        Construct a new instance.
        Parameters:
        initial - the initial size, in pages
        maximum - the maximum size, in pages
        shared - true if the limits apply to a shared memory segment, or false otherwise
    • Method Detail

      • defaultLimits

        public static MemoryLimits defaultLimits()
        Returns:
        the default memory limits
      • initialPages

        public int initialPages()
        Returns:
        the initial size, in pages
      • maximumPages

        public int maximumPages()
        Returns:
        the maximum size, in pages
      • shared

        public boolean shared()
        Returns:
        true if the limits apply to a shared memory segment, or false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object