public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "孙世龙 sunshilong" <sunshilong369@gmail.com>
To: Dan Kegel <dank@kegel.com>, gcc-help@gcc.gnu.org
Subject: Re: Is realloc(3) permitted to fail when shrinking a block?
Date: Tue, 11 Aug 2020 14:35:59 +0800	[thread overview]
Message-ID: <CAAvDm6ag4hDo6StTm7x-CdGefmWB3LQKZ0iq405vbK+1hXMgbg@mail.gmail.com> (raw)
In-Reply-To: <CAPF-yObSfu+EkzeeVzZ9fe6BMM9JW-JhPcEXjb9+0dZxj0ELWw@mail.gmail.com>

Thank you for your reply.

>If the heap's corrupt, yes, it can fail...
Could you please explain that in more detail?
What confuses me is that how can it fails to shrink memory while there
is enough memory pointed by the input argument of realloc(3) function
(
i.e. ptr,  here is the declaration of realloc(3):void *realloc(void
*ptr, size_t size);
) at least.

Thank you for your attention to this matter.

On Tue, Aug 11, 2020 at 11:59 AM Dan Kegel <dank@kegel.com> wrote:
>
> If the heap's corrupt, yes, it can fail...
>
> On Mon, Aug 10, 2020 at 8:54 PM 孙世龙 sunshilong via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>>
>> As the subject, I couldn't find any positive or negative statements
>> about this matter in the Linux Programmer's Manual.
>>
>> Could somebody shed some light on this matter?
>>
>> Thank you for your attention to this matter.
>> Best regards.
>> Sunshilong
>>

  reply	other threads:[~2020-08-11  6:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  3:54 孙世龙 sunshilong
2020-08-11  3:58 ` Dan Kegel
2020-08-11  6:35   ` 孙世龙 sunshilong [this message]
2020-08-11  7:22     ` Jonathan Wakely
2020-08-12 11:23       ` 孙世龙 sunshilong
2020-08-12 11:59         ` Jonathan Wakely
2020-08-15  7:07 ` Florian Weimer

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=CAAvDm6ag4hDo6StTm7x-CdGefmWB3LQKZ0iq405vbK+1hXMgbg@mail.gmail.com \
    --to=sunshilong369@gmail.com \
    --cc=dank@kegel.com \
    --cc=gcc-help@gcc.gnu.org \
    /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).