hotspot/src/share/vm/memory/virtualspace.hpp
changeset 46746 ea379ebb9447
parent 42650 1f304d0c888b
equal deleted inserted replaced
46745:f7b9bb98bb72 46746:ea379ebb9447
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    61   ReservedSpace(size_t size, size_t alignment, bool large, bool executable);
    61   ReservedSpace(size_t size, size_t alignment, bool large, bool executable);
    62 
    62 
    63   // Accessors
    63   // Accessors
    64   char*  base()            const { return _base;      }
    64   char*  base()            const { return _base;      }
    65   size_t size()            const { return _size;      }
    65   size_t size()            const { return _size;      }
       
    66   char*  end()             const { return _base + _size; }
    66   size_t alignment()       const { return _alignment; }
    67   size_t alignment()       const { return _alignment; }
    67   bool   special()         const { return _special;   }
    68   bool   special()         const { return _special;   }
    68   bool   executable()      const { return _executable;   }
    69   bool   executable()      const { return _executable;   }
    69   size_t noaccess_prefix() const { return _noaccess_prefix;   }
    70   size_t noaccess_prefix() const { return _noaccess_prefix;   }
    70   bool is_reserved()       const { return _base != NULL; }
    71   bool is_reserved()       const { return _base != NULL; }
    83   // Alignment
    84   // Alignment
    84   static size_t page_align_size_up(size_t size);
    85   static size_t page_align_size_up(size_t size);
    85   static size_t page_align_size_down(size_t size);
    86   static size_t page_align_size_down(size_t size);
    86   static size_t allocation_align_size_up(size_t size);
    87   static size_t allocation_align_size_up(size_t size);
    87   static size_t allocation_align_size_down(size_t size);
    88   static size_t allocation_align_size_down(size_t size);
       
    89   bool contains(const void* p) const {
       
    90     return (base() <= ((char*)p)) && (((char*)p) < (base() + size()));
       
    91   }
    88 };
    92 };
    89 
    93 
    90 ReservedSpace
    94 ReservedSpace
    91 ReservedSpace::first_part(size_t partition_size, bool split, bool realloc)
    95 ReservedSpace::first_part(size_t partition_size, bool split, bool realloc)
    92 {
    96 {