< prev index next >

src/hotspot/share/gc/z/zAddressRangeMap.hpp

Print this page




  21  * questions.
  22  */
  23 
  24 #ifndef SHARE_GC_Z_ZADDRESSRANGEMAP_HPP
  25 #define SHARE_GC_Z_ZADDRESSRANGEMAP_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 
  29 template<typename T, size_t AddressRangeShift>
  30 class ZAddressRangeMapIterator;
  31 
  32 template <typename T, size_t AddressRangeShift>
  33 class ZAddressRangeMap {
  34   friend class VMStructs;
  35   friend class ZAddressRangeMapIterator<T, AddressRangeShift>;
  36 
  37 private:
  38   T* const _map;
  39 
  40   size_t index_for_addr(uintptr_t addr) const;

  41 
  42 public:
  43   ZAddressRangeMap();
  44   ~ZAddressRangeMap();
  45 
  46   T* addr() const;
  47   size_t size() const;
  48 
  49   T get(uintptr_t addr) const;
  50   void put(uintptr_t addr, T value);
  51 };
  52 
  53 template <typename T, size_t AddressRangeShift>
  54 class ZAddressRangeMapIterator : public StackObj {
  55 public:
  56   const ZAddressRangeMap<T, AddressRangeShift>* const _map;
  57   size_t                                              _next;
  58 
  59 public:
  60   ZAddressRangeMapIterator(const ZAddressRangeMap<T, AddressRangeShift>* map);
  61 
  62   bool next(T* value);
  63 };
  64 
  65 #endif // SHARE_GC_Z_ZADDRESSRANGEMAP_HPP


  21  * questions.
  22  */
  23 
  24 #ifndef SHARE_GC_Z_ZADDRESSRANGEMAP_HPP
  25 #define SHARE_GC_Z_ZADDRESSRANGEMAP_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 
  29 template<typename T, size_t AddressRangeShift>
  30 class ZAddressRangeMapIterator;
  31 
  32 template <typename T, size_t AddressRangeShift>
  33 class ZAddressRangeMap {
  34   friend class VMStructs;
  35   friend class ZAddressRangeMapIterator<T, AddressRangeShift>;
  36 
  37 private:
  38   T* const _map;
  39 
  40   size_t index_for_addr(uintptr_t addr) const;
  41   size_t size() const;
  42 
  43 public:
  44   ZAddressRangeMap();
  45   ~ZAddressRangeMap();



  46 
  47   T get(uintptr_t addr) const;
  48   void put(uintptr_t addr, T value);
  49 };
  50 
  51 template <typename T, size_t AddressRangeShift>
  52 class ZAddressRangeMapIterator : public StackObj {
  53 public:
  54   const ZAddressRangeMap<T, AddressRangeShift>* const _map;
  55   size_t                                              _next;
  56 
  57 public:
  58   ZAddressRangeMapIterator(const ZAddressRangeMap<T, AddressRangeShift>* map);
  59 
  60   bool next(T* value);
  61 };
  62 
  63 #endif // SHARE_GC_Z_ZADDRESSRANGEMAP_HPP
< prev index next >