equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2018, 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. |
167 assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res)); |
167 assert((allocation & allocation_mask) == 0, "address should be aligned to 4 bytes at least: " INTPTR_FORMAT, p2i(res)); |
168 assert(type <= allocation_mask, "incorrect allocation type"); |
168 assert(type <= allocation_mask, "incorrect allocation type"); |
169 ResourceObj* resobj = (ResourceObj *)res; |
169 ResourceObj* resobj = (ResourceObj *)res; |
170 resobj->_allocation_t[0] = ~(allocation + type); |
170 resobj->_allocation_t[0] = ~(allocation + type); |
171 if (type != STACK_OR_EMBEDDED) { |
171 if (type != STACK_OR_EMBEDDED) { |
172 // Called from operator new() and CollectionSetChooser(), |
172 // Called from operator new(), set verification value. |
173 // set verification value. |
|
174 resobj->_allocation_t[1] = (uintptr_t)&(resobj->_allocation_t[1]) + type; |
173 resobj->_allocation_t[1] = (uintptr_t)&(resobj->_allocation_t[1]) + type; |
175 } |
174 } |
176 } |
175 } |
177 |
176 |
178 ResourceObj::allocation_type ResourceObj::get_allocation_type() const { |
177 ResourceObj::allocation_type ResourceObj::get_allocation_type() const { |