From e0a66c157439fc5512e3406542a5a96667f2e452 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 29 Jan 2008 17:28:27 +0000 Subject: 2008-01-29 Joel Sherrill * libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h, libcsupport/src/malloc_walk.c, libcsupport/src/posix_memalign.c, libcsupport/src/realloc.c, score/src/heapwalk.c: Add rtems_memalign as helper and as exposed nmemalign variant with few restrictions. Also turn on compilation of _Heap_Walk but make forced calls to it conditionally compiled. This should allow more flexibility to the user as to run-time checking of the heap. * libcsupport/src/rtems_memalign.c: New file. --- cpukit/libcsupport/include/rtems/malloc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpukit/libcsupport/include/rtems/malloc.h') diff --git a/cpukit/libcsupport/include/rtems/malloc.h b/cpukit/libcsupport/include/rtems/malloc.h index e347082819..d5b5eb691d 100644 --- a/cpukit/libcsupport/include/rtems/malloc.h +++ b/cpukit/libcsupport/include/rtems/malloc.h @@ -125,4 +125,24 @@ void malloc_report_statistics_with_plugin( rtems_printk_plugin_t print ); +/** + * + * This method is a help memalign implementation which does all + * error checking done by posix_memalign() EXCEPT it does NOT + * place numeric restrictions on the alignment value. + * + * @param[in] pointer points to the user pointer + * @param[in] alignment is the desired alignment + * @param[in] size is the allocation request size in bytes + * + * @return This methods returns zero on success and a POSIX errno + * value to indicate the failure condition. On success + * *pointer will contain the address of the allocated memory. + */ +int rtems_memalign( + void **pointer, + size_t alignment, + size_t size +); + #endif -- cgit v1.2.3