From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: valid_pointer_p Date: Sat, 12 Aug 2006 14:06:25 +0300 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1155380803 20459 80.91.229.2 (12 Aug 2006 11:06:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Aug 2006 11:06:43 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 12 13:06:41 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GBrK9-0006L9-Qe for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2006 13:06:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GBrK9-0007xS-BT for ged-emacs-devel@m.gmane.org; Sat, 12 Aug 2006 07:06:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GBrJw-0007vG-Ac for emacs-devel@gnu.org; Sat, 12 Aug 2006 07:06:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GBrJu-0007qm-J3 for emacs-devel@gnu.org; Sat, 12 Aug 2006 07:06:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GBrJu-0007qZ-9H for emacs-devel@gnu.org; Sat, 12 Aug 2006 07:06:22 -0400 Original-Received: from [192.114.186.73] (helo=heller.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GBrPF-0004gV-DV for emacs-devel@gnu.org; Sat, 12 Aug 2006 07:11:53 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-154-186.inter.net.il [80.230.154.186]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id AFB36471 (AUTH halo1); Sat, 12 Aug 2006 14:06:19 +0300 (IDT) Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58311 Archived-At: > Cc: emacs-devel@gnu.org > From: storm@cua.dk (Kim F. Storm) > Date: Sat, 12 Aug 2006 00:58:05 +0200 > > Eli Zaretskii writes: > > > Well, I figured that much. But we do know the length of each object, > > so we could validate exactly what is needed, right? Just add another > > argument to valid_pointer_p that tells it how many bytes to validate. > > The problem is that you have to deref the pointer to know the length > of the object... ??? Don't we have macros, like INTEGERP, SUBRP, etc. to do that without dereferencing? The length of the primitive Lisp types is known, right? Even if you are right, dereferencing a pointer accesses a region in memory whose length is known in advance, so at most we will need to call valid_pointer_p twice.