equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2019, 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. |
29 #include "runtime/thread.inline.hpp" |
29 #include "runtime/thread.inline.hpp" |
30 #include "services/memTracker.hpp" |
30 #include "services/memTracker.hpp" |
31 |
31 |
32 void ResourceArea::bias_to(MEMFLAGS new_flags) { |
32 void ResourceArea::bias_to(MEMFLAGS new_flags) { |
33 if (new_flags != _flags) { |
33 if (new_flags != _flags) { |
|
34 size_t size = size_in_bytes(); |
|
35 MemTracker::record_arena_size_change(-ssize_t(size), _flags); |
34 MemTracker::record_arena_free(_flags); |
36 MemTracker::record_arena_free(_flags); |
35 MemTracker::record_new_arena(new_flags); |
37 MemTracker::record_new_arena(new_flags); |
|
38 MemTracker::record_arena_size_change(ssize_t(size), new_flags); |
36 _flags = new_flags; |
39 _flags = new_flags; |
37 } |
40 } |
38 } |
41 } |
39 |
42 |
40 //------------------------------ResourceMark----------------------------------- |
43 //------------------------------ResourceMark----------------------------------- |