From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62044 invoked by alias); 4 Jul 2018 16:41:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 62028 invoked by uid 89); 4 Jul 2018 16:41:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=reserved, our X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jul 2018 16:41:32 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w64GfPba008815 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 4 Jul 2018 12:41:30 -0400 Received: by simark.ca (Postfix, from userid 112) id D18B41EF28; Wed, 4 Jul 2018 12:41:25 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 503E61E08D; Wed, 4 Jul 2018 12:41:25 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 04 Jul 2018 16:41:00 -0000 From: Simon Marchi To: Pedro Alves Cc: gdb-patches@sourceware.org, tom@tromey.com Subject: Re: [PATCH 2/2] darwin: Don't use sbrk In-Reply-To: <9b0d4749-f2cf-647c-cccf-a8a8ab4e982b@redhat.com> References: <20180704043033.29212-1-simon.marchi@polymtl.ca> <20180704043033.29212-2-simon.marchi@polymtl.ca> <9b0d4749-f2cf-647c-cccf-a8a8ab4e982b@redhat.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00108.txt.bz2 On 2018-07-04 06:49, Pedro Alves wrote: > On 07/04/2018 05:30 AM, Simon Marchi wrote: >> This patch gets rid of this warning on macOS: >> > >> sbrk on macOS is not useful for our purposes, since sbrk(0) always >> returns the same value. From what I read, brk/sbrk on macOS is just >> an >> emulation, it always returns a pointer in a 4MB section reserved for >> that. >> > >> --- a/gdb/common/common-defs.h >> +++ b/gdb/common/common-defs.h >> @@ -105,4 +105,8 @@ >> /* String containing the current directory (what getwd would return). >> */ >> extern char *current_directory; >> > > Suggest adding a comment here based on what you had in the intro: > > /* sbrk on macOS is not useful for our purposes, since sbrk(0) always > returns the same value. brk/sbrk on macOS is just an emulation > that always returns a pointer to a 4MB section reserved for > that. */ Of course, that's a good idea. Otherwise somebody will curse in 10 years, wondering why we did this, just like we did for the #if __APPLE_CC__ in gettext :). I'm pushing with that added, thanks for providing the comment. Simon