Merge pull request #22542 from 2m/wip-resize-mat-connections-2m
#22429 Resize connections array when needed
This commit is contained in:
commit
11c513fda7
3 changed files with 9 additions and 8 deletions
|
|
@ -579,9 +579,9 @@ final class GraphStageIsland(
|
|||
subflowFuser: OptionVal[GraphInterpreterShell ⇒ ActorRef]) extends PhaseIsland[GraphStageLogic] {
|
||||
// TODO: remove these
|
||||
private val logicArrayType = Array.empty[GraphStageLogic]
|
||||
private[this] val logics = new ArrayList[GraphStageLogic](64)
|
||||
// TODO: Resize
|
||||
private val connections = new Array[Connection](64)
|
||||
private[this] val logics = new ArrayList[GraphStageLogic](16)
|
||||
|
||||
private var connections = new Array[Connection](16)
|
||||
private var maxConnections = 0
|
||||
private var outConnections: List[Connection] = Nil
|
||||
private var fullIslandName: OptionVal[String] = OptionVal.None
|
||||
|
|
@ -613,6 +613,9 @@ final class GraphStageIsland(
|
|||
|
||||
def conn(slot: Int): Connection = {
|
||||
maxConnections = math.max(slot, maxConnections)
|
||||
if (maxConnections >= connections.length) {
|
||||
connections = java.util.Arrays.copyOf(connections, connections.length * 2)
|
||||
}
|
||||
val c = connections(slot)
|
||||
if (c ne null) c
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue