tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni Pool.java Shm.java
Date Thu, 03 Feb 2005 07:48:32 GMT
mturk       2005/02/02 23:48:32

  Modified:    jni/java/org/apache/tomcat/jni Pool.java Shm.java
  Log:
  Add NIO ByteBuffer direct memory allocation.
  
  Revision  Changes    Path
  1.3       +20 -2     jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Pool.java
  
  Index: Pool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Pool.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Pool.java	14 Jan 2005 14:42:37 -0000	1.2
  +++ Pool.java	3 Feb 2005 07:48:32 -0000	1.3
  @@ -16,6 +16,8 @@
   
   package org.apache.tomcat.jni;
   
  +import java.nio.ByteBuffer;
  +
   /** Pool
    *
    * @author Mladen Turk
  @@ -98,7 +100,7 @@
   
       /**
        * Register a process to be killed when a pool dies.
  -     * @param a The pool to use to define the processes lifetime 
  +     * @param a The pool to use to define the processes lifetime
        * @param proc The process to register
        * @param how How to kill the process, one of:
        * <PRE>
  @@ -111,4 +113,20 @@
        */
       public static native void noteSubprocess(long a, long proc, int how);
   
  +    /**
  +     * Allocate a block of memory from a pool
  +     * @param p The pool to allocate from
  +     * @param size The amount of memory to allocate
  +     * @return The ByteBuffer with allocated memory
  +     */
  +    public static ByteBuffer alloc(long p, int size);
  +
  +    /**
  +     * Allocate a block of memory from a pool and set all of the memory to 0
  +     * @param p The pool to allocate from
  +     * @param size The amount of memory to allocate
  +     * @return The ByteBuffer with allocated memory
  +     */
  +    public static ByteBuffer calloc(long p, int size);
  +
   }
  
  
  
  1.3       +13 -4     jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Shm.java
  
  Index: Shm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Shm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Shm.java	14 Jan 2005 14:42:37 -0000	1.2
  +++ Shm.java	3 Feb 2005 07:48:32 -0000	1.3
  @@ -16,6 +16,7 @@
   
   package org.apache.tomcat.jni;
   
  +import java.nio.ByteBuffer;
   /** Shm
    *
    * @author Mladen Turk
  @@ -105,7 +106,15 @@
        * @param m The shared memory segment from which to retrieve
        *        the segment length.
        */
  -    public static native long size(long m);
  -
  +    public static native ByteBuffer buffer(long m);
  +    /**
  +     * Retrieve new ByteBuffer base address of the shared memory segment.
  +     * NOTE: This address is only usable within the callers address
  +     * space, since this API does not guarantee that other attaching
  +     * processes will maintain the same address mapping.
  +     * @param m The shared memory segment from which to retrieve
  +     *        the base address.
  +     * @return address, aligned by APR_ALIGN_DEFAULT.
  +     */
   
  -}
  \ No newline at end of file
  +}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message