1 /* |
1 /* |
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2015, 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. |
82 err_msg("Invalid card pointer: " |
82 err_msg("Invalid card pointer: " |
83 "card_ptr: " PTR_FORMAT ", " |
83 "card_ptr: " PTR_FORMAT ", " |
84 "_ct_bot: " PTR_FORMAT, |
84 "_ct_bot: " PTR_FORMAT, |
85 p2i(card_ptr), p2i(_ct_bot))); |
85 p2i(card_ptr), p2i(_ct_bot))); |
86 size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte)); |
86 size_t card_num = pointer_delta(card_ptr, _ct_bot, sizeof(jbyte)); |
87 assert(card_num >= 0 && card_num < _reserved_max_card_num, |
87 assert(card_num < _reserved_max_card_num, |
88 err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr))); |
88 err_msg("card pointer out of range: " PTR_FORMAT, p2i(card_ptr))); |
89 return card_num; |
89 return card_num; |
90 } |
90 } |
91 |
91 |
92 jbyte* card_num_2_ptr(size_t card_num) { |
92 jbyte* card_num_2_ptr(size_t card_num) { |
93 assert(card_num >= 0 && card_num < _reserved_max_card_num, |
93 assert(card_num < _reserved_max_card_num, |
94 err_msg("card num out of range: "SIZE_FORMAT, card_num)); |
94 err_msg("card num out of range: "SIZE_FORMAT, card_num)); |
95 return (jbyte*) (_ct_bot + card_num); |
95 return (jbyte*) (_ct_bot + card_num); |
96 } |
96 } |
97 |
97 |
98 // Clear the counts table for the given (exclusive) index range. |
98 // Clear the counts table for the given (exclusive) index range. |