- if (mmalloc_pagesize == 0) { // Not initialized yet
- mmalloc_pagesize = (int)sysconf(_SC_PAGESIZE);
- }
+ static unsigned long mmalloc_pagesize = 0;
+ if (!mmalloc_pagesize)
+ mmalloc_pagesize = (unsigned long)sysconf(_SC_PAGESIZE);
- fprintf(stderr, "Internal error: mmap returned MAP_FAILED! pagesize:%d error: %s\n", mmalloc_pagesize,
+ fprintf(stderr, "Internal error: mmap returned MAP_FAILED! pagesize:%lu error: %s\n", mmalloc_pagesize,
strerror(errno));
snprintf(buff, 1024, "cat /proc/%d/maps", getpid());
int status = system(buff);
strerror(errno));
snprintf(buff, 1024, "cat /proc/%d/maps", getpid());
int status = system(buff);