Skip to content

Commit

Permalink
Update to Netty 4.1.50.
Browse files Browse the repository at this point in the history
The substitution for `io.netty.channel.nio.NioEventLoop` isn't enough
anymore to not use the JC tools queues. Instead, we allow reflective
field access in those.
  • Loading branch information
michael-simons committed Jun 25, 2020
1 parent d2e63b1 commit 5129a63
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.45.Final</version>
<version>4.1.50.Final</version>
</dependency>

<dependency>
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/ac/simons/netty/example/svm/NettySubstitutions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.JdkLoggerFactory;

import java.util.Queue;
import java.util.concurrent.LinkedBlockingDeque;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

Expand All @@ -21,17 +18,6 @@ private static InternalLoggerFactory newDefaultFactory(String name) {
}
}


@TargetClass(className = "io.netty.channel.nio.NioEventLoop")
final class Target_io_netty_channel_nio_NioEventLoop {

@Substitute
private static Queue<Runnable> newTaskQueue0(int maxPendingTasks) {
return new LinkedBlockingDeque<>();
}
}


class NettySubstitutions {

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,41 @@
{
"name" : "io.netty.util.ReferenceCountUtil",
"allDeclaredMethods" : true
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField",
"fields": [
{"name": "producerIndex", "allowUnsafeAccess": true}
]
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField",
"fields": [
{"name": "producerLimit", "allowUnsafeAccess": true}
]
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField",
"fields": [
{"name": "consumerIndex", "allowUnsafeAccess": true}
]
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields",
"fields": [
{"name": "producerIndex", "allowUnsafeAccess": true}
]
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields",
"fields": [
{"name": "producerLimit", "allowUnsafeAccess": true}
]
},
{
"name" : "io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields",
"fields": [
{"name": "consumerIndex", "allowUnsafeAccess": true}
]
}
]

0 comments on commit 5129a63

Please sign in to comment.