Class Id2FS

  • All Implemented Interfaces:
    java.lang.Iterable<TOP>

    public class Id2FS
    extends java.lang.Object
    implements java.lang.Iterable<TOP>
    A map from ints representing FS id's (or "addresses") to those FSs There is one map instance per CAS (all views). The map is not populated, normally. It is only populated when there is a need to be able to map from the id to the FS, or to prevent the FS from being GC'd -- The low level CAS apis for creating FSs have this need, because they return the id, and this won't prevent the FS from being GC'd. Removes not supported; they happen when the map is reset / cleared This corresponds to the v2 property of "once created, a FS cannot be reclaimed (until reset)" Threading: to support read-only views, concurrent with updates, needs to be thread safe
    • Constructor Detail

      • Id2FS

        public Id2FS​(int initialHeapSize)
    • Method Detail

      • maybeReport

        private void maybeReport()
      • put

        void put​(int id,
                 TOP fs)
        put but assert wasn't there before
      • putUnconditionally

        void putUnconditionally​(TOP fs)
        Skips the assert that the item wasn't already present
        Parameters:
        fs - the fs to add
      • putChange

        void putChange​(int id,
                       TOP fs)
        make an id map to an fs, asserting there was a previous mapping for this id
        Parameters:
        id - -
        fs - -
      • put

        void put​(TOP fs)
      • get

        TOP get​(int id)
      • size

        int size()
      • clear

        void clear()
        adjusts the underlying array down in size if grew beyond the reset heap size value
      • traceWeakGets

        void traceWeakGets()
      • iterator

        public IteratorNvc<TOP> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<TOP>