public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, tom@tromey.com
Subject: Re: [PATCH 2/2] darwin: Don't use sbrk
Date: Wed, 04 Jul 2018 16:41:00 -0000	[thread overview]
Message-ID: <fdeab4a6d3eb3b017c0d2b59c2af4be0@polymtl.ca> (raw)
In-Reply-To: <9b0d4749-f2cf-647c-cccf-a8a8ab4e982b@redhat.com>

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

  reply	other threads:[~2018-07-04 16:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  4:31 [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Simon Marchi
2018-07-04  4:31 ` [PATCH 2/2] darwin: Don't use sbrk Simon Marchi
2018-07-04 10:49   ` Pedro Alves
2018-07-04 16:41     ` Simon Marchi [this message]
2018-07-04 10:31 ` [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Pedro Alves
2018-07-04 16:39   ` Simon Marchi
2018-07-05 16:12     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdeab4a6d3eb3b017c0d2b59c2af4be0@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).