10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/systemDictionary.hpp"
27 #include "classfile/vmSymbols.hpp"
28 #include "memory/allocation.inline.hpp"
29 #include "oops/oop.inline.hpp"
30 #include "runtime/handles.inline.hpp"
31 #include "runtime/javaCalls.hpp"
32 #include "runtime/orderAccess.hpp"
33 #include "services/lowMemoryDetector.hpp"
34 #include "services/management.hpp"
35 #include "services/memoryManager.hpp"
36 #include "services/memoryPool.hpp"
37 #include "services/memoryService.hpp"
38 #include "services/gcNotifier.hpp"
39 #include "utilities/dtrace.hpp"
40
41 MemoryManager::MemoryManager(const char* name) : _name(name) {
42 _num_pools = 0;
43 (void)const_cast<instanceOop&>(_memory_mgr_obj = instanceOop(NULL));
44 }
45
46 int MemoryManager::add_pool(MemoryPool* pool) {
47 int index = _num_pools;
48 assert(index < MemoryManager::max_num_pools, "_num_pools exceeds the max");
49 if (index < MemoryManager::max_num_pools) {
50 _pools[index] = pool;
51 _num_pools++;
52 }
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/systemDictionary.hpp"
27 #include "classfile/vmSymbols.hpp"
28 #include "memory/allocation.inline.hpp"
29 #include "oops/oop.inline.hpp"
30 #include "runtime/atomic.hpp"
31 #include "runtime/handles.inline.hpp"
32 #include "runtime/javaCalls.hpp"
33 #include "services/lowMemoryDetector.hpp"
34 #include "services/management.hpp"
35 #include "services/memoryManager.hpp"
36 #include "services/memoryPool.hpp"
37 #include "services/memoryService.hpp"
38 #include "services/gcNotifier.hpp"
39 #include "utilities/dtrace.hpp"
40
41 MemoryManager::MemoryManager(const char* name) : _name(name) {
42 _num_pools = 0;
43 (void)const_cast<instanceOop&>(_memory_mgr_obj = instanceOop(NULL));
44 }
45
46 int MemoryManager::add_pool(MemoryPool* pool) {
47 int index = _num_pools;
48 assert(index < MemoryManager::max_num_pools, "_num_pools exceeds the max");
49 if (index < MemoryManager::max_num_pools) {
50 _pools[index] = pool;
51 _num_pools++;
52 }
|