1 /* |
1 /* |
2 * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 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. |
61 |
61 |
62 // Sort into allocation site addresses and memory type order for baseline comparison |
62 // Sort into allocation site addresses and memory type order for baseline comparison |
63 int compare_malloc_site_and_type(const MallocSite& s1, const MallocSite& s2) { |
63 int compare_malloc_site_and_type(const MallocSite& s1, const MallocSite& s2) { |
64 int res = compare_malloc_site(s1, s2); |
64 int res = compare_malloc_site(s1, s2); |
65 if (res == 0) { |
65 if (res == 0) { |
66 res = (int)(s1.flags() - s2.flags()); |
66 res = (int)(s1.flag() - s2.flag()); |
67 } |
67 } |
68 |
68 |
69 return res; |
69 return res; |
70 } |
70 } |
71 |
71 |
207 |
207 |
208 VirtualMemoryAllocationIterator itr = virtual_memory_allocations(); |
208 VirtualMemoryAllocationIterator itr = virtual_memory_allocations(); |
209 const ReservedMemoryRegion* rgn; |
209 const ReservedMemoryRegion* rgn; |
210 VirtualMemoryAllocationSite* site; |
210 VirtualMemoryAllocationSite* site; |
211 while ((rgn = itr.next()) != NULL) { |
211 while ((rgn = itr.next()) != NULL) { |
212 VirtualMemoryAllocationSite tmp(*rgn->call_stack()); |
212 VirtualMemoryAllocationSite tmp(*rgn->call_stack(), rgn->flag()); |
213 site = allocation_sites.find(tmp); |
213 site = allocation_sites.find(tmp); |
214 if (site == NULL) { |
214 if (site == NULL) { |
215 LinkedListNode<VirtualMemoryAllocationSite>* node = |
215 LinkedListNode<VirtualMemoryAllocationSite>* node = |
216 allocation_sites.add(tmp); |
216 allocation_sites.add(tmp); |
217 if (node == NULL) return false; |
217 if (node == NULL) return false; |