dnl test if we have pthread_attr_setstack; if not use the older calls
AC_CHECK_LIB(pthread, pthread_attr_setstack,
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
- [Defined if libpthread has pthread_attr_setstack]))
+ [Defined if libpthread has pthread_attr_setstack ()]))
+
+dnl test if we have posix_memalign; FreeBSD doesn't
+AC_CHECK_FUNC(posix_memalign,
+ AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
+ [Defined if we have posix_memalign ()]))
if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
int retval = 0;
+#ifdef HAVE_POSIX_MEMALIGN
retval = posix_memalign (stack, STACK_SIZE, STACK_SIZE);
if (retval != 0)
{
}
GST_DEBUG (GST_CAT_THREAD, "have posix_memalign at %p of size %d",
(void *) *stack, STACK_SIZE);
+#else
+ if ((*stack = valloc (STACK_SIZE)) != 0)
+ {
+ g_warning ("Could not valloc stack !\n");
+ return FALSE;
+ }
+ GST_DEBUG (GST_CAT_THREAD, "have valloc at %p of size %d",
+ (void *) *stack, STACK_SIZE);
+#endif
+
GST_DEBUG (GST_CAT_COTHREADS,
"Got new cothread stack from %p to %p (size %ld)",
*stack, *stack + STACK_SIZE - 1, (long) STACK_SIZE);