Skip to content

Commit

Permalink
Add workaround in #69
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Nov 25, 2022
1 parent 835de98 commit 9765b7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,11 @@ class LBufferTest extends LArraySpec {
}
}

import scala.collection.parallel.CollectionConverters._

test("allocate concurrently") {

val N = 100
def range = (0 until N).par
val N = 100

def range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val R = 2
val S = 1024 * 1024

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package xerial.larray.buffer

import xerial.larray.LArraySpec
import scala.collection.parallel.CollectionConverters._

/**
* @author
Expand All @@ -38,7 +37,8 @@ class MemoryAllocatorTest extends LArraySpec {

val t = time("alloc", repeat = 5) {
block("concurrent") {
val l = for (i <- (0 until N).par) yield {
val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val l = for (i <- range) yield {
val a = new LBuffer(B)
a(B - 1) = 1.toByte
a
Expand All @@ -47,7 +47,8 @@ class MemoryAllocatorTest extends LArraySpec {
}

block("Array") {
val l = for (i <- (0 until N).par) yield {
val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val l = for (i <- range) yield {
val a = new Array[Int](B)
a(B - 1) = 1
a
Expand Down

0 comments on commit 9765b7e

Please sign in to comment.