| 6 | package test.nativemem; |
| 7 | |
| 8 | public class CallsRealloc { |
| 9 | |
| 10 | private static final int MALLOC_SIZE = 1999993; // Prime size, useful in assertions. |
| 11 | private static final int REALLOC_SIZE = 30000170; |
| 12 | |
| 13 | public static void main(String[] args) throws InterruptedException { |
| 14 | final boolean once = args.length > 0 && args[0].equals("once"); |
| 15 | |
| 16 | do { |
| 17 | long addr = Native.malloc(MALLOC_SIZE); |
| 18 | long reallocd = Native.realloc(addr, REALLOC_SIZE); |
| 19 | |
| 20 | // allocate every 1 second. |
| 21 | Thread.sleep(1000); |
| 22 | } while (!once); |
| 23 | } |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected