Solaris portability, POSIX memalign() missing - PATCH [2/6]
Use memalign() instead... Joakim
svn diff malloc_zone.h Index: malloc_zone.h =================================================================== --- malloc_zone.h (revision 140) +++ malloc_zone.h (working copy) @@ -80,14 +80,28 @@ return (realloc(ptr, size)); }
+/* posix_memalign is not supported with the current shipping release of Solaris 10, it is + fixed in the latest available Solaris Nevada (next-gen) distribution though, see: + + http://bugs.opensolaris.org/bugdatabase/view_bug.do;jsessionid=3af20a8d00f37... + + Falling back at using memalign() here as is done by Sun in the implementation at: + http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/... + */ + static inline void * malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) { +#ifdef HAS_POSIX_MEMALIGN void *ptr; if (posix_memalign(&ptr, alignment, size) < 0) return (NULL); + return (ptr); +#else + return memalign(alignment, size); +#endif } static inline void octo.tbricks.com:trunk/src/shims>
participants (1)
-
Joakim Johansson