diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c index 171cdade81a..9cd87503c5a 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -80,6 +80,7 @@ extern POINTER_TYPE *sbrk (); | |||
| 80 | 80 | ||
| 81 | #ifdef WINDOWSNT | 81 | #ifdef WINDOWSNT |
| 82 | #include <fcntl.h> | 82 | #include <fcntl.h> |
| 83 | #include "w32.h" | ||
| 83 | #endif | 84 | #endif |
| 84 | 85 | ||
| 85 | #ifdef DOUG_LEA_MALLOC | 86 | #ifdef DOUG_LEA_MALLOC |
| @@ -129,17 +130,27 @@ static pthread_mutex_t alloc_mutex; | |||
| 129 | #define BLOCK_INPUT_ALLOC \ | 130 | #define BLOCK_INPUT_ALLOC \ |
| 130 | do \ | 131 | do \ |
| 131 | { \ | 132 | { \ |
| 132 | pthread_mutex_lock (&alloc_mutex); \ | 133 | if (!in_sighandler) \ |
| 133 | if (pthread_self () == main_thread) \ | 134 | { \ |
| 134 | BLOCK_INPUT; \ | 135 | pthread_mutex_lock (&alloc_mutex); \ |
| 136 | if (pthread_self () == main_thread) \ | ||
| 137 | BLOCK_INPUT; \ | ||
| 138 | else \ | ||
| 139 | sigblock (sigmask (SIGIO)); \ | ||
| 140 | } \ | ||
| 135 | } \ | 141 | } \ |
| 136 | while (0) | 142 | while (0) |
| 137 | #define UNBLOCK_INPUT_ALLOC \ | 143 | #define UNBLOCK_INPUT_ALLOC \ |
| 138 | do \ | 144 | do \ |
| 139 | { \ | 145 | { \ |
| 140 | if (pthread_self () == main_thread) \ | 146 | if (!in_sighandler) \ |
| 141 | UNBLOCK_INPUT; \ | 147 | { \ |
| 142 | pthread_mutex_unlock (&alloc_mutex); \ | 148 | pthread_mutex_unlock (&alloc_mutex); \ |
| 149 | if (pthread_self () == main_thread) \ | ||
| 150 | UNBLOCK_INPUT; \ | ||
| 151 | else \ | ||
| 152 | sigunblock (sigmask (SIGIO)); \ | ||
| 153 | } \ | ||
| 143 | } \ | 154 | } \ |
| 144 | while (0) | 155 | while (0) |
| 145 | 156 | ||
| @@ -4572,6 +4583,9 @@ int | |||
| 4572 | valid_pointer_p (p) | 4583 | valid_pointer_p (p) |
| 4573 | void *p; | 4584 | void *p; |
| 4574 | { | 4585 | { |
| 4586 | #ifdef WINDOWSNT | ||
| 4587 | return w32_valid_pointer_p (p, 16); | ||
| 4588 | #else | ||
| 4575 | int fd; | 4589 | int fd; |
| 4576 | 4590 | ||
| 4577 | /* Obviously, we cannot just access it (we would SEGV trying), so we | 4591 | /* Obviously, we cannot just access it (we would SEGV trying), so we |
| @@ -4588,6 +4602,7 @@ valid_pointer_p (p) | |||
| 4588 | } | 4602 | } |
| 4589 | 4603 | ||
| 4590 | return -1; | 4604 | return -1; |
| 4605 | #endif | ||
| 4591 | } | 4606 | } |
| 4592 | 4607 | ||
| 4593 | /* Return 1 if OBJ is a valid lisp object. | 4608 | /* Return 1 if OBJ is a valid lisp object. |