From unknown Tue Aug 19 10:01:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8800 <8800@debbugs.gnu.org> To: bug#8800 <8800@debbugs.gnu.org> Subject: Status: 24.0.50: At revno: 104484 alloc.c does not compile Reply-To: bug#8800 <8800@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:01:59 +0000 retitle 8800 24.0.50: At revno: 104484 alloc.c does not compile reassign 8800 emacs submitter 8800 Peter Dyballa severity 8800 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 04 06:34:22 2011 Received: (at submit) by debbugs.gnu.org; 4 Jun 2011 10:34:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QSoBR-0005sh-Gc for submit@debbugs.gnu.org; Sat, 04 Jun 2011 06:34:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QSoBP-0005sV-7Z for submit@debbugs.gnu.org; Sat, 04 Jun 2011 06:34:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSoBJ-0002Fu-DQ for submit@debbugs.gnu.org; Sat, 04 Jun 2011 06:34:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:57806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSoBJ-0002Fq-C5 for submit@debbugs.gnu.org; Sat, 04 Jun 2011 06:34:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSoBI-0007Pq-5K for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2011 06:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSoBH-0002FY-3j for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2011 06:34:12 -0400 Received: from mout6.freenet.de ([195.4.92.96]:34301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSoBG-0002FD-V1 for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2011 06:34:11 -0400 Received: from [195.4.92.10] (helo=0.mx.freenet.de) by mout6.freenet.de with esmtpa (ID peter_dyballa@freenet.de) (port 25) (Exim 4.76 #2) id 1QSoBD-0008Tc-SC for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2011 12:34:07 +0200 Received: from p5b2839d8.dip.t-dialin.net ([91.40.57.216]:54649 helo=[192.168.1.2]) by 0.mx.freenet.de with esmtpsa (ID peter_dyballa@freenet.de) (TLSv1:AES128-SHA:128) (port 587) (Exim 4.72 #5) id 1QSoBC-0007rl-LB for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2011 12:34:07 +0200 Message-Id: <5E561F1D-99CA-49B7-ADAB-8AC7553FBEC1@Freenet.DE> From: Peter Dyballa To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: 24.0.50: At revno: 104484 alloc.c does not compile Date: Sat, 4 Jun 2011 12:34:04 +0200 X-Mailer: Apple Mail (2.936) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) Hello! The is the report of GCC 4.5.2: alloc.c: In function =91memory_full=92: alloc.c:3286:7: error: =91SPARE_MEMORY=92 undeclared (first use in this =20= function) alloc.c:3286:7: note: each undeclared identifier is reported only once =20= for each function it appears in In src/alloc.c I have: 187 /* Points to memory space allocated as "spare", to be freed if =20= we run 188 out of memory. We keep one large block, four cons-blocks, = and 189 two string blocks. */ 190=09 191 static char *spare_memory[7]; 192=09 193 #ifndef SYSTEM_MALLOC 194 /* Amount of spare memory to keep in large reserve block. */ 195=09 196 #define SPARE_MEMORY (1 << 14) 197 #endif In src/config.h I have, around line #1060: #define SYSTEM_MALLOC 1 so SPARE_MEMORY does not get defined. -- Greetings Pete And always remember the last words of my grandfather, who said: =93A =20 truck!=94 =97 Emo Phillips From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 06 00:59:40 2011 Received: (at 8800-done) by debbugs.gnu.org; 6 Jun 2011 04:59:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTRud-0001Z8-JK for submit@debbugs.gnu.org; Mon, 06 Jun 2011 00:59:39 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTRua-0001Yv-Vj for 8800-done@debbugs.gnu.org; Mon, 06 Jun 2011 00:59:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 5F58939E8119; Sun, 5 Jun 2011 21:59:31 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NYABCY+ysPN7; Sun, 5 Jun 2011 21:59:30 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 365B839E80F7; Sun, 5 Jun 2011 21:59:30 -0700 (PDT) Message-ID: <4DEC5EA8.6000904@cs.ucla.edu> Date: Sun, 05 Jun 2011 21:59:20 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: Glenn Morris Subject: Re: Compilation error caused by SPARE_MEMORY References: <9n62ok6j1i.fsf@fencepost.gnu.org> In-Reply-To: <9n62ok6j1i.fsf@fencepost.gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8800-done Cc: 8800-done@debbugs.gnu.org, Emacs Development X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 06/05/11 14:54, Glenn Morris wrote: > As reported in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8800 Thanks, that is a bug I recently introduced; it affects hosts such as MacOS that define SYSTEM_MALLOC. I fixed it in the trunk with bzr 104508, as follows: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-06-05 22:46:26 +0000 +++ src/ChangeLog 2011-06-06 04:54:23 +0000 @@ -1,3 +1,11 @@ +2011-06-06 Paul Eggert + + * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800). + Do not assume that spare memory exists; that assumption is valid + only if SYSTEM_MALLOC. + (LARGE_REQUEST): New macro, so that the issue of large requests + is separated from the issue of spare memory. + 2011-06-05 Andreas Schwab * editfns.c (Fformat): Correctly handle zero flag with hexadecimal === modified file 'src/alloc.c' --- src/alloc.c 2011-06-02 08:35:28 +0000 +++ src/alloc.c 2011-06-06 04:54:23 +0000 @@ -196,6 +196,12 @@ #define SPARE_MEMORY (1 << 14) #endif +#ifdef SYSTEM_MALLOC +# define LARGE_REQUEST (1 << 14) +#else +# define LARGE_REQUEST SPARE_MEMORY +#endif + /* Number of extra blocks malloc should get when it needs more core. */ static int malloc_hysteresis; @@ -3283,15 +3289,12 @@ { /* Do not go into hysterics merely because a large request failed. */ int enough_free_memory = 0; - if (SPARE_MEMORY < nbytes) + if (LARGE_REQUEST < nbytes) { - void *p = malloc (SPARE_MEMORY); + void *p = malloc (LARGE_REQUEST); if (p) { - if (spare_memory[0]) - free (p); - else - spare_memory[0] = p; + free (p); enough_free_memory = 1; } } From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 06 12:11:22 2011 Received: (at 8800-done) by debbugs.gnu.org; 6 Jun 2011 16:11:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTcOf-0002fg-Nl for submit@debbugs.gnu.org; Mon, 06 Jun 2011 12:11:22 -0400 Received: from mail-iy0-f172.google.com ([209.85.210.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTYWD-0004mH-Ig for 8800-done@debbugs.gnu.org; Mon, 06 Jun 2011 08:02:54 -0400 Received: by iyn15 with SMTP id 15so3624703iyn.3 for <8800-done@debbugs.gnu.org>; Mon, 06 Jun 2011 05:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=5Kn7BqPxwUzJuYQOluuBTJg6CHuUa0uzJ3WRMq/dBdI=; b=tYGhnq6p8X52oVZ2Ye8m4/eEmBG9zi7nJnnijmpyHtees3yKwCb6Wn5nSouzQc6qKc RAu4dzKICz2UaXzQcvoJYZ5yQ1Kzmd9YXlOgFF2MnyQ/29YiljPjXQ9/D1DWdEdIphsZ DrUarcjS6O/n7geW/sMRMHK1wVuM+7dKEV1us= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=US8WGC1E+vaZTLBGEhG8zCDAWHaQatf9SXadkpFX2qdLYpGrY5Hv3G9jFpgqJbEPVg RZIw5XiIZxXWrn/JmJsym5cypjAhg/8e8GEa83heORb1FgBF9rY5HqZACjlNIlmqVBJ3 /TJp/IX5sD+hLfC4FTNKkxmUmFocDBDHLU2J4= Received: by 10.42.6.10 with SMTP id 10mr6047192icy.58.1307361767574; Mon, 06 Jun 2011 05:02:47 -0700 (PDT) Received: from [192.168.1.104] (173-30-221-186.client.mchsi.com [173.30.221.186]) by mx.google.com with ESMTPS id y1sm2723548ica.4.2011.06.06.05.02.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2011 05:02:46 -0700 (PDT) Subject: Re: Compilation error caused by SPARE_MEMORY Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Donald Ephraim Curtis In-Reply-To: <4DEC5EA8.6000904@cs.ucla.edu> Date: Mon, 6 Jun 2011 07:02:40 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <9n62ok6j1i.fsf@fencepost.gnu.org> <4DEC5EA8.6000904@cs.ucla.edu> To: Paul Eggert X-Mailer: Apple Mail (2.1084) X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 8800-done X-Mailman-Approved-At: Mon, 06 Jun 2011 12:11:21 -0400 Cc: Glenn Morris , 8800-done@debbugs.gnu.org, Emacs Development X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) I'm sorry, I've looked at the code currently in alloc.c (revision = 104510) and I don't see how this is doing anything other than defining = LARGE_REQUEST as (1 << 14) Here is the relevant code: /* Amount of spare memory to keep in large reserve block. */ #define SPARE_MEMORY (1 << 14) #ifdef SYSTEM_MALLOC # define LARGE_REQUEST (1 << 14) #else # define LARGE_REQUEST SPARE_MEMORY #endif But shouldn't there still be a check to see if SPARE_MEMORY is defined = already? On Jun 5, 2011, at 23:59, Paul Eggert wrote: > On 06/05/11 14:54, Glenn Morris wrote: >=20 >> As reported in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8800 >=20 > Thanks, that is a bug I recently introduced; it affects hosts such > as MacOS that define SYSTEM_MALLOC. I fixed it in the trunk with > bzr 104508, as follows: >=20 > =3D=3D=3D modified file 'src/ChangeLog' > --- src/ChangeLog 2011-06-05 22:46:26 +0000 > +++ src/ChangeLog 2011-06-06 04:54:23 +0000 > @@ -1,3 +1,11 @@ > +2011-06-06 Paul Eggert > + > + * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS = (Bug#8800). > + Do not assume that spare memory exists; that assumption is valid > + only if SYSTEM_MALLOC. > + (LARGE_REQUEST): New macro, so that the issue of large requests > + is separated from the issue of spare memory. > + > 2011-06-05 Andreas Schwab >=20 > * editfns.c (Fformat): Correctly handle zero flag with = hexadecimal >=20 > =3D=3D=3D modified file 'src/alloc.c' > --- src/alloc.c 2011-06-02 08:35:28 +0000 > +++ src/alloc.c 2011-06-06 04:54:23 +0000 > @@ -196,6 +196,12 @@ > #define SPARE_MEMORY (1 << 14) > #endif >=20 > +#ifdef SYSTEM_MALLOC > +# define LARGE_REQUEST (1 << 14) > +#else > +# define LARGE_REQUEST SPARE_MEMORY > +#endif > + > /* Number of extra blocks malloc should get when it needs more core. = */ >=20 > static int malloc_hysteresis; > @@ -3283,15 +3289,12 @@ > { > /* Do not go into hysterics merely because a large request failed. = */ > int enough_free_memory =3D 0; > - if (SPARE_MEMORY < nbytes) > + if (LARGE_REQUEST < nbytes) > { > - void *p =3D malloc (SPARE_MEMORY); > + void *p =3D malloc (LARGE_REQUEST); > if (p) > { > - if (spare_memory[0]) > - free (p); > - else > - spare_memory[0] =3D p; > + free (p); > enough_free_memory =3D 1; > } > } >=20 >=20 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 06 12:42:47 2011 Received: (at 8800) by debbugs.gnu.org; 6 Jun 2011 16:42:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTct5-0003PL-77 for submit@debbugs.gnu.org; Mon, 06 Jun 2011 12:42:47 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTct1-0003P7-Hx for 8800@debbugs.gnu.org; Mon, 06 Jun 2011 12:42:44 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1013939E8121; Mon, 6 Jun 2011 09:42:38 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xfh16drQ+q2X; Mon, 6 Jun 2011 09:42:37 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7C92939E80F0; Mon, 6 Jun 2011 09:42:37 -0700 (PDT) Message-ID: <4DED0375.9010006@cs.ucla.edu> Date: Mon, 06 Jun 2011 09:42:29 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: Donald Ephraim Curtis Subject: Re: Compilation error caused by SPARE_MEMORY References: <9n62ok6j1i.fsf@fencepost.gnu.org> <4DEC5EA8.6000904@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 8800 Cc: Glenn Morris , 8800@debbugs.gnu.org, Emacs Development X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) On 06/06/11 05:02, Donald Ephraim Curtis wrote: > shouldn't there still be a check to see if SPARE_MEMORY is defined already? If SYSTEM_MALLOC is not defined, SPARE_MEMORY must be defined, so the code is OK. This can be seen by looking at the larger context in alloc.c. However, I can see that the code is confusing, so I simplified it this way: * alloc.c: Simplify handling of large-request failures (Bug#8800). (SPARE_MEMORY): Always define. (LARGE_REQUEST): Remove. (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST. === modified file 'src/alloc.c' --- src/alloc.c 2011-06-06 04:54:23 +0000 +++ src/alloc.c 2011-06-06 16:39:06 +0000 @@ -190,17 +190,10 @@ static char *spare_memory[7]; -#ifndef SYSTEM_MALLOC -/* Amount of spare memory to keep in large reserve block. */ +/* Amount of spare memory to keep in large reserve block, or to see + whether this much is available when malloc fails on a larger request. */ #define SPARE_MEMORY (1 << 14) -#endif - -#ifdef SYSTEM_MALLOC -# define LARGE_REQUEST (1 << 14) -#else -# define LARGE_REQUEST SPARE_MEMORY -#endif /* Number of extra blocks malloc should get when it needs more core. */ @@ -3289,9 +3282,9 @@ { /* Do not go into hysterics merely because a large request failed. */ int enough_free_memory = 0; - if (LARGE_REQUEST < nbytes) + if (SPARE_MEMORY < nbytes) { - void *p = malloc (LARGE_REQUEST); + void *p = malloc (SPARE_MEMORY); if (p) { free (p); From unknown Tue Aug 19 10:01:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Jul 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator