"cacheflow/model_executor/memory_analyzer.py" did not exist on "cfae35b861c5fc0c9f3689f99c7aba2e4501beb8"
Commit 9dc6c659 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

lib/nicif: add SHM_ROUND_UP to round up shm size

Useful for huge pages.
parent 652c75c6
...@@ -107,6 +107,11 @@ int shm_create(const char *path, size_t size, void **addr) { ...@@ -107,6 +107,11 @@ int shm_create(const char *path, size_t size, void **addr) {
int fd; int fd;
void *p; void *p;
#ifdef SHM_ROUND_UP
if (size % SHM_ROUND_UP != 0)
size += SHM_ROUND_UP - (size % SHM_ROUND_UP);
#endif
if ((fd = open(path, O_CREAT | O_RDWR, 0666)) == -1) { if ((fd = open(path, O_CREAT | O_RDWR, 0666)) == -1) {
perror("util_create_shmsiszed: open failed"); perror("util_create_shmsiszed: open failed");
goto error_out; goto error_out;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment