[Git][java-team/jboss-xnio][upstream] New upstream version 3.8.1

Markus Koschany gitlab at salsa.debian.org
Mon May 18 21:53:46 BST 2020



Markus Koschany pushed to branch upstream at Debian Java Maintainers / jboss-xnio


Commits:
2ff83656 by Markus Koschany at 2020-05-18T22:37:25+02:00
New upstream version 3.8.1
- - - - -


4 changed files:

- api/pom.xml
- api/src/main/java/org/xnio/ByteBufferSlicePool.java
- nio-impl/pom.xml
- pom.xml


Changes:

=====================================
api/pom.xml
=====================================
@@ -37,7 +37,7 @@
     <parent>
         <groupId>org.jboss.xnio</groupId>
         <artifactId>xnio-all</artifactId>
-        <version>3.8.0.Final</version>
+        <version>3.8.1.Final</version>
     </parent>
 
     <dependencies>


=====================================
api/src/main/java/org/xnio/ByteBufferSlicePool.java
=====================================
@@ -155,11 +155,15 @@ public final class ByteBufferSlicePool implements Pool<ByteBuffer> {
         // only true if using direct allocation
         if (directBuffers != null) {
             ByteBuffer region = FREE_DIRECT_BUFFERS.poll();
-            if (region != null) {
-                return sliceReusedBuffer(region, buffersPerRegion, bufferSize);
+            try {
+                if (region != null) {
+                    return sliceReusedBuffer(region, buffersPerRegion, bufferSize);
+                }
+                region = allocator.allocate(buffersPerRegion * bufferSize);
+                return sliceAllocatedBuffer(region, buffersPerRegion, bufferSize);
+            } finally {
+                directBuffers.add(region);
             }
-            region = allocator.allocate(buffersPerRegion * bufferSize);
-            return sliceAllocatedBuffer(region, buffersPerRegion, bufferSize);
         }
         return sliceAllocatedBuffer(
                 allocator.allocate(buffersPerRegion * bufferSize),
@@ -206,8 +210,11 @@ public final class ByteBufferSlicePool implements Pool<ByteBuffer> {
         if(!sliceQueue.isEmpty()) {
             sliceQueue.clear();
         }
-        // pass everything that is directly allocated to free direct buffers
-        FREE_DIRECT_BUFFERS.addAll(directBuffers);
+        // only true if using direct allocation
+        if (directBuffers != null) {
+            // pass everything that is directly allocated to free direct buffers
+            FREE_DIRECT_BUFFERS.addAll(directBuffers);
+        }
     }
 
     /**


=====================================
nio-impl/pom.xml
=====================================
@@ -31,7 +31,7 @@
     <parent>
         <groupId>org.jboss.xnio</groupId>
         <artifactId>xnio-all</artifactId>
-        <version>3.8.0.Final</version>
+        <version>3.8.1.Final</version>
     </parent>
     
     <properties>


=====================================
pom.xml
=====================================
@@ -32,7 +32,7 @@
     <artifactId>xnio-all</artifactId>
     <packaging>pom</packaging>
     <name>XNIO Parent POM</name>
-    <version>3.8.0.Final</version>
+    <version>3.8.1.Final</version>
     <description>The aggregator POM of the XNIO project</description>
 
     <licenses>



View it on GitLab: https://salsa.debian.org/java-team/jboss-xnio/-/commit/2ff836560bc5375c43fa1305a0995e9db4a8d9f9

-- 
View it on GitLab: https://salsa.debian.org/java-team/jboss-xnio/-/commit/2ff836560bc5375c43fa1305a0995e9db4a8d9f9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200518/2b44d542/attachment.html>


More information about the pkg-java-commits mailing list