From e68176270479c9ca806c21fb0ab1c03b1b1e3fb3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Nov 2014 16:12:59 +0100 Subject: bdbuf: Use rtems_cache_aligned_malloc() --- cpukit/libblock/src/bdbuf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'cpukit/libblock') diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c index e1ed0397c2..bae57e2adf 100644 --- a/cpukit/libblock/src/bdbuf.c +++ b/cpukit/libblock/src/bdbuf.c @@ -19,7 +19,7 @@ * Rewritten to remove score mutex access. Fixes many performance * issues. * - * Copyright (c) 2009-2012 embedded brains GmbH. + * Copyright (c) 2009-2014 embedded brains GmbH. */ /** @@ -39,7 +39,6 @@ #include #include -#include #include "rtems/bdbuf.h" @@ -1599,14 +1598,12 @@ rtems_bdbuf_do_init (void) /* * Allocate memory for buffer memory. The buffer memory will be cache - * aligned. It is possible to free the memory allocated by rtems_memalign() - * with free(). Return 0 if allocated. - * - * The memory allocate allows a + * aligned. It is possible to free the memory allocated by + * rtems_cache_aligned_malloc() with free(). */ - if (rtems_memalign ((void **) &bdbuf_cache.buffers, - rtems_cache_get_data_line_size(), - bdbuf_cache.buffer_min_count * bdbuf_config.buffer_min) != 0) + bdbuf_cache.buffers = rtems_cache_aligned_malloc(bdbuf_cache.buffer_min_count + * bdbuf_config.buffer_min); + if (bdbuf_cache.buffers == NULL) goto error; /* -- cgit v1.2.3