|
28 | 28 | * <p/><b>Implementation notes:</b>
|
29 | 29 | * <br/>This was originally an ordered chain of non-overlapping Intervals,
|
30 | 30 | * together with a fixed size array cache for freed integers.
|
31 |
| - * <br/>{@link #reserve()} was expensive in this scheme, whereas in the |
32 |
| - * present implementation it is O(1), as is {@link #free()}. |
33 |
| - * <br/>Although {@link #allocate()} is slightly slower than O(1) and in the |
34 |
| - * worst case could be O(N), the use of the {@link #lastIndex} field |
| 31 | + * <br/>{@link #reserve(int)} was expensive in this scheme, whereas in the |
| 32 | + * present implementation it is O(1), as is {@link #free(int)}. |
| 33 | + * <p>Although {@link #allocate()} is slightly slower than O(1) and in the |
| 34 | + * worst case could be O(N), the use of a "<code>lastIndex</code>" field |
35 | 35 | * for starting the next scan for free integers means this is negligible.
|
36 |
| - * <br/>The data representation overhead is O(N) where N is the size of the |
| 36 | + * </p> |
| 37 | + * <p>The data representation overhead is O(N) where N is the size of the |
37 | 38 | * allocation range. One <code>long</code> is used for every 64 integers in the
|
38 | 39 | * range.
|
39 |
| - * <br/>Very little Object creation and destruction occurs in use. |
| 40 | + * </p> |
| 41 | + * <p>Very little Object creation and destruction occurs in use.</p> |
40 | 42 | */
|
41 | 43 | public class IntAllocator {
|
42 | 44 |
|
43 | 45 | private final int loRange; // the integer bit 0 represents
|
44 |
| - private final int hiRange; // the integer(+1) the highest bit represents |
| 46 | + private final int hiRange; // one more than the integer the highest bit represents |
45 | 47 | private final int numberOfBits; // relevant in freeSet
|
46 | 48 | private int lastIndex = 0; // for searching for FREE integers
|
47 | 49 | /** A bit is SET in freeSet if the corresponding integer is FREE
|
|
0 commit comments