-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [fix] maybe a recycle bug * [fix] add read-index timeout scanner
- Loading branch information
1 parent
0d8c96f
commit e0f5daf
Showing
9 changed files
with
193 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ public SegmentList(final boolean recycleSegment) { | |
} | ||
|
||
/** | ||
* A recyclable segment. | ||
* A recyclable segment. | ||
* @author boyan([email protected]) | ||
* | ||
* @param <T> | ||
|
@@ -117,6 +117,7 @@ int cap() { | |
return SEGMENT_SIZE - this.pos; | ||
} | ||
|
||
@SuppressWarnings("SuspiciousSystemArraycopy") | ||
private void addAll(final Object[] src, final int srcPos, final int len) { | ||
System.arraycopy(src, srcPos, this.elements, this.pos, len); | ||
this.pos += len; | ||
|
@@ -261,7 +262,8 @@ public boolean isEmpty() { | |
|
||
/** | ||
* Remove elements from first until predicate returns false. | ||
* @param predicate | ||
* | ||
* @param predicate predicate functional interface | ||
*/ | ||
public void removeFromFirstWhen(final Predicate<T> predicate) { | ||
Segment<T> firstSeg = getFirst(); | ||
|
@@ -293,7 +295,8 @@ public void clear() { | |
|
||
/** | ||
* Remove elements from last until predicate returns false. | ||
* @param predicate | ||
* | ||
* @param predicate predicate functional interface | ||
*/ | ||
public void removeFromLastWhen(final Predicate<T> predicate) { | ||
Segment<T> lastSeg = getLast(); | ||
|
@@ -371,7 +374,7 @@ public void addAll(final Collection<T> coll) { | |
} | ||
|
||
private Object[] coll2Array(final Collection<T> coll) { | ||
Object[] src = null; | ||
Object[] src; | ||
if (coll instanceof ArrayList && UnsafeUtil.hasUnsafe()) { | ||
src = LIST_ARRAY_GETTER.get((ArrayList<T>) coll); | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters