malloc memory still needs to be aligned, if we are doing direct IO
[fio.git] / memory.c
index 46eb852a63ed69d59d71972d777009eddbe11a19..c147229e27c67d4135bfe9c64be82f8dbe8e2c46 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -126,7 +126,12 @@ static int alloc_mem_mmap(struct thread_data *td)
 
 static int alloc_mem_malloc(struct thread_data *td)
 {
-       td->orig_buffer = malloc(td->orig_buffer_size);
+       unsigned int bsize = td->orig_buffer_size;
+
+       if (td->o.odirect)
+               bsize += page_mask;
+               
+       td->orig_buffer = malloc(bsize);
        if (td->orig_buffer)
                return 0;