1853 return empty_range();
1854 }
1855 return AddrRange(from, to - from);
1856 }
1857 };
1858
1859 ////////////////////////////////////////////////////////////////////////////
1860 // shared memory bookkeeping
1861 //
1862 // the os::reserve_memory() API and friends hand out different kind of memory, depending
1863 // on need and circumstances. Memory may be allocated with mmap() or with shmget/shmat.
1864 //
1865 // But these memory types have to be treated differently. For example, to uncommit
1866 // mmap-based memory, msync(MS_INVALIDATE) is needed, to uncommit shmat-based memory,
1867 // disclaim64() is needed.
1868 //
1869 // Therefore we need to keep track of the allocated memory segments and their
1870 // properties.
1871
1872 // ShmBkBlock: base class for all blocks in the shared memory bookkeeping
1873 class ShmBkBlock {
1874
1875 ShmBkBlock* _next;
1876
1877 protected:
1878
1879 AddrRange _range;
1880 const size_t _pagesize;
1881 const bool _pinned;
1882
1883 public:
1884
1885 ShmBkBlock(AddrRange range, size_t pagesize, bool pinned)
1886 : _range(range), _pagesize(pagesize), _pinned(pinned) , _next(NULL) {
1887
1888 assert(_pagesize == SIZE_4K || _pagesize == SIZE_64K || _pagesize == SIZE_16M, "invalid page size");
1889 assert(!_range.is_empty(), "invalid range");
1890 }
1891
1892 virtual void print(outputStream* st) const {
1893 st->print("0x%p ... 0x%p (%llu) - %d %s pages - %s",
|
1853 return empty_range();
1854 }
1855 return AddrRange(from, to - from);
1856 }
1857 };
1858
1859 ////////////////////////////////////////////////////////////////////////////
1860 // shared memory bookkeeping
1861 //
1862 // the os::reserve_memory() API and friends hand out different kind of memory, depending
1863 // on need and circumstances. Memory may be allocated with mmap() or with shmget/shmat.
1864 //
1865 // But these memory types have to be treated differently. For example, to uncommit
1866 // mmap-based memory, msync(MS_INVALIDATE) is needed, to uncommit shmat-based memory,
1867 // disclaim64() is needed.
1868 //
1869 // Therefore we need to keep track of the allocated memory segments and their
1870 // properties.
1871
1872 // ShmBkBlock: base class for all blocks in the shared memory bookkeeping
1873 class ShmBkBlock : public CHeapObj<mtInternal> {
1874
1875 ShmBkBlock* _next;
1876
1877 protected:
1878
1879 AddrRange _range;
1880 const size_t _pagesize;
1881 const bool _pinned;
1882
1883 public:
1884
1885 ShmBkBlock(AddrRange range, size_t pagesize, bool pinned)
1886 : _range(range), _pagesize(pagesize), _pinned(pinned) , _next(NULL) {
1887
1888 assert(_pagesize == SIZE_4K || _pagesize == SIZE_64K || _pagesize == SIZE_16M, "invalid page size");
1889 assert(!_range.is_empty(), "invalid range");
1890 }
1891
1892 virtual void print(outputStream* st) const {
1893 st->print("0x%p ... 0x%p (%llu) - %d %s pages - %s",
|