From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: make-regexp error memory leak Date: Mon, 26 Jul 2004 20:56:47 -0500 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87u0vui55s.fsf@trouble.defaultvalue.org> References: <87pt7bpbzo.fsf@zip.com.au> <87brir67fk.fsf@trouble.defaultvalue.org> <87eknmnjc5.fsf@zip.com.au> <87vfgxt5vx.fsf@trouble.defaultvalue.org> <878ydsk9qa.fsf@zip.com.au> <87ekniqtjl.fsf@trouble.defaultvalue.org> <878ydajpc2.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1090893515 635 80.91.224.253 (27 Jul 2004 01:58:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jul 2004 01:58:35 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 27 03:58:26 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BpHEY-0002Pz-00 for ; Tue, 27 Jul 2004 03:58:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpHHc-0007zf-8j for guile-devel@m.gmane.org; Mon, 26 Jul 2004 22:01:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BpHHY-0007y8-S3 for guile-devel@gnu.org; Mon, 26 Jul 2004 22:01:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BpHHX-0007xn-8U for guile-devel@gnu.org; Mon, 26 Jul 2004 22:01:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpHHX-0007xd-5a for guile-devel@gnu.org; Mon, 26 Jul 2004 22:01:31 -0400 Original-Received: from [66.93.216.237] (helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BpHE8-0006Ys-Cb for guile-devel@gnu.org; Mon, 26 Jul 2004 21:58:00 -0400 Original-Received: from trouble.defaultvalue.org (omen.defaultvalue.org [192.168.1.1]) by defaultvalue.org (Postfix) with ESMTP id C9A0640CB for ; Mon, 26 Jul 2004 20:57:57 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id E773E410AC; Mon, 26 Jul 2004 20:56:48 -0500 (CDT) Original-To: guile-devel@gnu.org In-Reply-To: <878ydajpc2.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 24 Jul 2004 09:06:37 +1000") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3893 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3893 Kevin Ryde writes: > Ah, a bit dodgy that. > > If you're hunting dodginess, it looks like make-s16vector may assume a > short is 16-bits when converting the "fill" parameter from an SCM. A > system with a bigger short probably gets values silently truncated > instead of provoking range errors. Similarly u16, and s32 and u32 > with "int". Yep, thanks, though I *think*, I've probably already fixed those. I something similar to this for each one: SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" "initialize the elements, otherwise the contents of the vector\n" "is unspecified.") #define FUNC_NAME s_scm_make_s16vector { SCM uvec; size_t count = scm_num2size (n, 1, s_scm_make_s16vector); uvec = make_uvec (1, FUNC_NAME, SCM_UVEC_S16, count); if (SCM_UNBNDP (fill)) memset (SCM_UVEC_BASE (uvec), 0, count * sizeof (int_s16)); else { int_s16 * p; int f = scm_num2int (fill, 2, FUNC_NAME); #if SIZEOF_INT > 2 SCM_ASSERT_RANGE (2, fill, (f >= (int_s16) -32768) && (f <= (int_s16) 32767)); #endif p = (int_s16 *) SCM_UVEC_BASE (uvec); while (count-- > 0) *p++ = f; } return uvec; } #undef FUNC_NAME -- Rob Browning rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel