X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=smalloc.c;h=e48cfe8b1c11339d8e566743472795606668d588;hb=0cfe2089;hp=3ca29ff1404579d8be5068ee7b8455218fba6c3c;hpb=5f9454a2b5007a40f3c9479ce751ca35e0d21d76;p=fio.git diff --git a/smalloc.c b/smalloc.c index 3ca29ff1..e48cfe8b 100644 --- a/smalloc.c +++ b/smalloc.c @@ -13,6 +13,7 @@ #include #include +#include "fio.h" #include "mutex.h" #include "arch/arch.h" #include "os/os.h" @@ -248,7 +249,7 @@ static void *postred_ptr(struct block_hdr *hdr) uintptr_t ptr; ptr = (uintptr_t) hdr + hdr->size - sizeof(unsigned int); - ptr = (ptr + int_mask) & ~int_mask; + ptr = (uintptr_t) PTR_ALIGN(ptr, int_mask); return (void *) ptr; } @@ -450,6 +451,8 @@ void *smalloc(size_t size) break; } while (1); + log_err("smalloc: OOM. Consider using --alloc-size to increase the " + "shared memory available.\n"); return NULL; }