src/share/vm/memory/filemap.hpp

changeset 6868
ca6d25be853b
parent 5863
85c1ca43713f
child 6876
710a3c8b516e
child 7241
8cb56c8cb30d
     1.1 --- a/src/share/vm/memory/filemap.hpp	Tue Aug 12 11:12:25 2014 -0700
     1.2 +++ b/src/share/vm/memory/filemap.hpp	Tue Aug 12 17:46:16 2014 -0400
     1.3 @@ -54,7 +54,7 @@
     1.4  
     1.5    bool  _file_open;
     1.6    int   _fd;
     1.7 -  long  _file_offset;
     1.8 +  size_t  _file_offset;
     1.9  
    1.10    // FileMapHeader describes the shared space data in the file to be
    1.11    // mapped.  This structure gets written to a file.  It is not a class, so
    1.12 @@ -62,12 +62,14 @@
    1.13  
    1.14    struct FileMapHeader {
    1.15      int    _magic;                    // identify file type.
    1.16 +    int    _crc;                      // header crc checksum.
    1.17      int    _version;                  // (from enum, above.)
    1.18      size_t _alignment;                // how shared archive should be aligned
    1.19      int    _obj_alignment;            // value of ObjectAlignmentInBytes
    1.20  
    1.21      struct space_info {
    1.22 -      int    _file_offset;   // sizeof(this) rounded to vm page size
    1.23 +      int    _crc;           // crc checksum of the current space
    1.24 +      size_t _file_offset;   // sizeof(this) rounded to vm page size
    1.25        char*  _base;          // copy-on-write base address
    1.26        size_t _capacity;      // for validity checking
    1.27        size_t _used;          // for setting space top on read
    1.28 @@ -104,6 +106,8 @@
    1.29    }
    1.30  
    1.31    static int current_version()        { return _current_version; }
    1.32 +  int    compute_header_crc();
    1.33 +  void   set_header_crc(int crc)      { _header._crc = crc; }
    1.34    void   populate_header(size_t alignment);
    1.35    bool   validate();
    1.36    void   invalidate();
    1.37 @@ -136,6 +140,7 @@
    1.38    void  write_bytes_aligned(const void* buffer, int count);
    1.39    char* map_region(int i);
    1.40    void  unmap_region(int i);
    1.41 +  bool  verify_region_checksum(int i);
    1.42    void  close();
    1.43    bool  is_open() { return _file_open; }
    1.44    ReservedSpace reserve_shared_memory();

mercurial