lioux's virtual patch

Original commit message from CVS:
lioux's virtual patch
This commit is contained in:
Thomas Vander Stichele 2002-07-11 21:38:23 +00:00
parent 92de697c34
commit a64e400a97
2 changed files with 17 additions and 1 deletions

View file

@ -323,7 +323,12 @@ fi
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])

View file

@ -499,6 +499,7 @@ cothread_stackquery (void **stack, glong* stacksize)
int retval = 0;
#ifdef HAVE_POSIX_MEMALIGN
retval = posix_memalign (stack, STACK_SIZE, STACK_SIZE);
if (retval != 0)
{
@ -514,6 +515,16 @@ cothread_stackquery (void **stack, glong* stacksize)
}
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);