From: Heikki Lindholm <holindho@cs.helsinki.fi>
Subject: [PATCH] Add stack base support for Mac OS X
Date: Tue, 26 Dec 2006 12:41:38 +0200 [thread overview]
Message-ID: <4590FC62.1010507@cs.helsinki.fi> (raw)
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
This patch adds support for getting the stack base (and hence also
scm_init_guile()) on OS X. Tested only in one particular case I needed.
The patch is against the 1.8.1 release.
-- Heikki Lindholm
[-- Attachment #2: guile-1.8.1-MacOSX-stackbase-061226.patch --]
[-- Type: text/plain, Size: 886 bytes --]
--- ../guile-1.8.1.orig/libguile/threads.c 2006-07-29 21:00:17.000000000 +0300
+++ ./libguile/threads.c 2006-12-26 12:37:51.000000000 +0200
@@ -571,14 +571,17 @@
}
#if SCM_USE_PTHREAD_THREADS
-/* pthread_getattr_np not available on MacOS X and Solaris 10. */
-#if HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP
+/* pthread_getattr_np not available on Solaris 10. */
+#if (HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP) || defined(__APPLE__)
#define HAVE_GET_THREAD_STACK_BASE
static SCM_STACKITEM *
get_thread_stack_base ()
{
+#if defined(__APPLE__)
+ return pthread_get_stackaddr_np (pthread_self ());
+#else /* !defined(__APPLE__) */
pthread_attr_t attr;
void *start, *end;
size_t size;
@@ -604,6 +607,7 @@
return end;
#endif
}
+#endif /* defined(__APPLE__) */
}
#endif /* HAVE_PTHREAD_ATTR_GETSTACK && HAVE_PTHREAD_GETATTR_NP */
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2006-12-26 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-26 10:41 Heikki Lindholm [this message]
2006-12-26 19:45 ` [PATCH] Add stack base support for Mac OS X Kevin Ryde
2006-12-26 21:14 ` Heikki Lindholm
2006-12-26 22:04 ` Kevin Ryde
2006-12-26 22:24 ` Heikki Lindholm
2006-12-26 22:43 ` Kevin Ryde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4590FC62.1010507@cs.helsinki.fi \
--to=holindho@cs.helsinki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).