Package org.apache.tomcat.jni
Class Stdlib
java.lang.Object
org.apache.tomcat.jni.Stdlib
Deprecated.
The scope of the APR/Native Library will be reduced in Tomcat
              10.1.x / Tomcat Native 2.x onwards to only include those
              components required to provide OpenSSL integration with the NIO
              and NIO2 connectors.
Stdlib
- Author:
- Mladen Turk
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic longcalloc(int num, int sz) Deprecated.Allocates an array in memory with elements initialized to 0.static voidfree(long mem) Deprecated.Deallocates or frees a memory block.static intgetpid()Deprecated.Get current process pid.static intgetppid()Deprecated.Get current process parent pid.static longmalloc(int sz) Deprecated.Allocates memory blocks.static booleanmemread(byte[] dst, long src, int sz) Deprecated.Read from plain memorystatic booleanmemset(long dst, int c, int sz) Deprecated.Sets buffers to a specified characterstatic booleanmemwrite(long dst, byte[] src, int sz) Deprecated.Write to plain memorystatic longrealloc(long mem, int sz) Deprecated.Reallocate memory blocks.
- 
Constructor Details- 
Stdlibpublic Stdlib()Deprecated.
 
- 
- 
Method Details- 
memreadpublic static boolean memread(byte[] dst, long src, int sz) Deprecated.Read from plain memory- Parameters:
- dst- Destination byte array
- src- Source memory address
- sz- Number of bytes to copy.
- Returns:
- trueif the operation was successful
 
- 
memwritepublic static boolean memwrite(long dst, byte[] src, int sz) Deprecated.Write to plain memory- Parameters:
- dst- Destination memory address
- src- Source byte array
- sz- Number of bytes to copy.
- Returns:
- trueif the operation was successful
 
- 
memsetpublic static boolean memset(long dst, int c, int sz) Deprecated.Sets buffers to a specified character- Parameters:
- dst- Destination memory address
- c- Character to set.
- sz- Number of characters.
- Returns:
- trueif the operation was successful
 
- 
mallocpublic static long malloc(int sz) Deprecated.Allocates memory blocks.- Parameters:
- sz- Bytes to allocate.
- Returns:
- a pointer
 
- 
reallocpublic static long realloc(long mem, int sz) Deprecated.Reallocate memory blocks.- Parameters:
- mem- Pointer to previously allocated memory block.
- sz- New size in bytes.
- Returns:
- a pointer
 
- 
callocpublic static long calloc(int num, int sz) Deprecated.Allocates an array in memory with elements initialized to 0.- Parameters:
- num- Number of elements.
- sz- Length in bytes of each element.
- Returns:
- a pointer
 
- 
freepublic static void free(long mem) Deprecated.Deallocates or frees a memory block.- Parameters:
- mem- Previously allocated memory block to be freed.
 
- 
getpidpublic static int getpid()Deprecated.Get current process pid.- Returns:
- current pid or < 1 in case of error.
 
- 
getppidpublic static int getppid()Deprecated.Get current process parent pid.- Returns:
- parent pid or < 1 in case of error.
 
 
-