equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 2018, 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. |
58 // b) change all WordSize's to ByteSize's where desired and fix the compilation errors |
58 // b) change all WordSize's to ByteSize's where desired and fix the compilation errors |
59 |
59 |
60 |
60 |
61 #ifdef ASSERT |
61 #ifdef ASSERT |
62 |
62 |
63 class ByteSize VALUE_OBJ_CLASS_SPEC { |
63 class ByteSize { |
64 private: |
64 private: |
65 int _size; |
65 int _size; |
66 |
66 |
67 // Note: This constructor must be private to avoid implicit conversions! |
67 // Note: This constructor must be private to avoid implicit conversions! |
68 ByteSize(int size) { _size = size; } |
68 ByteSize(int size) { _size = size; } |
90 |
90 |
91 inline ByteSize in_ByteSize(int size) { return ByteSize(size); } |
91 inline ByteSize in_ByteSize(int size) { return ByteSize(size); } |
92 inline int in_bytes(ByteSize x) { return x._size; } |
92 inline int in_bytes(ByteSize x) { return x._size; } |
93 |
93 |
94 |
94 |
95 class WordSize VALUE_OBJ_CLASS_SPEC { |
95 class WordSize { |
96 private: |
96 private: |
97 int _size; |
97 int _size; |
98 |
98 |
99 // Note: This constructor must be private to avoid implicit conversions! |
99 // Note: This constructor must be private to avoid implicit conversions! |
100 WordSize(int size) { _size = size; } |
100 WordSize(int size) { _size = size; } |