don't inline, to be friendly to js engine osr
| 58 | |
| 59 | // don't inline, to be friendly to js engine osr |
| 60 | void __attribute__ ((noinline)) doit(char *buffer, int size, int i) { |
| 61 | static char *buffer2 = NULL; |
| 62 | static char *buffer3 = NULL; |
| 63 | |
| 64 | unsigned long maxCompressedSize = size * 2 + 10000; // whatever |
| 65 | |
| 66 | if (!buffer2) buffer2 = (char*)malloc(maxCompressedSize); |
| 67 | if (!buffer3) buffer3 = (char*)malloc(size); |
| 68 | |
| 69 | int64_t compressedSize = lzbench_lzma_compress(buffer, size, buffer2, maxCompressedSize, 4 /*level*/, 0, NULL); |
| 70 | |
| 71 | if (i == 0) printf("sizes: %d,%d\n", size, (int32_t)compressedSize); |
| 72 | |
| 73 | int64_t roundTrip = lzbench_lzma_decompress(buffer2, compressedSize, buffer3, size, 0, 0, NULL); |
| 74 | |
| 75 | assert(roundTrip == size); |
| 76 | if (i == 0) assert(strcmp(buffer, buffer3) == 0); |
| 77 | } |
| 78 | |
| 79 | int main(int argc, char **argv) { |
| 80 | int size, iters; |
no test coverage detected