Skip to content

Commit

Permalink
Avoid using the byte buffer used to calculate memory address quarkusi…
Browse files Browse the repository at this point in the history
…o#9750

* Recompute the field from a unused direct byte buffer.
* Also, set empty byte buffer memory address to 0.
  • Loading branch information
galderz committed Jun 4, 2020
1 parent 5c7b352 commit 8f76b86
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.netty.runtime.graal;

import java.nio.ByteBuffer;
import java.security.PrivateKey;
import java.security.Provider;
import java.security.cert.X509Certificate;
Expand Down Expand Up @@ -389,6 +390,19 @@ static Class<?> tryToLoadClass(final ClassLoader loader, final Class<?> helper)

}

@TargetClass(className = "io.netty.buffer.EmptyByteBuf")
final class Target_io_netty_buffer_EmptyByteBuf {

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias)
private static ByteBuffer EMPTY_BYTE_BUFFER = ByteBuffer.allocateDirect(0);

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias)
private static long EMPTY_BYTE_BUFFER_ADDRESS = 0;

}

class NettySubstitutions {

}

0 comments on commit 8f76b86

Please sign in to comment.