comparison src/alloc.c @ 72288:94e8cc9b752d

Include w32.h. (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do the job.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 05 Aug 2006 13:01:50 +0000
parents 4eba80d54b43
children 428ee64b35d5
comparison
equal deleted inserted replaced
72287:875a47d81ba5 72288:94e8cc9b752d
78 #define O_WRONLY 1 78 #define O_WRONLY 1
79 #endif 79 #endif
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
86 87
87 #include <malloc.h> 88 #include <malloc.h>
4613 /* Determine whether it is safe to access memory at address P. */ 4614 /* Determine whether it is safe to access memory at address P. */
4614 int 4615 int
4615 valid_pointer_p (p) 4616 valid_pointer_p (p)
4616 void *p; 4617 void *p;
4617 { 4618 {
4619 #ifdef WINDOWSNT
4620 return w32_valid_pointer_p (p, 16);
4621 #else
4618 int fd; 4622 int fd;
4619 4623
4620 /* Obviously, we cannot just access it (we would SEGV trying), so we 4624 /* Obviously, we cannot just access it (we would SEGV trying), so we
4621 trick the o/s to tell us whether p is a valid pointer. 4625 trick the o/s to tell us whether p is a valid pointer.
4622 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may 4626 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may
4629 unlink ("__Valid__Lisp__Object__"); 4633 unlink ("__Valid__Lisp__Object__");
4630 return valid; 4634 return valid;
4631 } 4635 }
4632 4636
4633 return -1; 4637 return -1;
4638 #endif
4634 } 4639 }
4635 4640
4636 /* Return 1 if OBJ is a valid lisp object. 4641 /* Return 1 if OBJ is a valid lisp object.
4637 Return 0 if OBJ is NOT a valid lisp object. 4642 Return 0 if OBJ is NOT a valid lisp object.
4638 Return -1 if we cannot validate OBJ. 4643 Return -1 if we cannot validate OBJ.