Created
March 4, 2019 11:00
-
-
Save kaityo256/40f9022b21dae2c0f19f20e98a3e65b5 to your computer and use it in GitHub Desktop.
Check mmapped arena
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <omp.h> | |
| const int N = 128; | |
| int main(void) { | |
| char *buf[N]; | |
| #pragma omp parallel for | |
| for (int i = 0; i < N; i++) { | |
| buf[i] = (char *)malloc(128); | |
| } | |
| bool mmapped_arena_is_used = false; | |
| for (int i = 0; i < N; i++) { | |
| size_t *p = (size_t *)buf[i]; | |
| if (*(p - 1) & 4) { | |
| mmapped_arena_is_used = true; | |
| break; | |
| } | |
| } | |
| if(mmapped_arena_is_used){ | |
| printf("mmapped arena is used.\n"); | |
| }else{ | |
| printf("mmapped arena is not used.\n"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment