unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 2/3] dynarray: Implement remove function
Date: Wed, 7 Feb 2018 14:06:09 -0200	[thread overview]
Message-ID: <f54369de-8bd1-4ed1-b5a0-dadc860bedba@linaro.org> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1802071744380.25773@monopod.intra.ispras.ru>



On 07/02/2018 12:48, Alexander Monakov wrote:
> On Wed, 7 Feb 2018, Adhemerval Zanella wrote:
> 
>> This patch implements the remove item function for dynarray array.
>> It is a costly operation, since it requires a memory move operation
>> possible as large as the array size less one element.
> 
> If preserving order is not required, then removing an element is as
> cheap as moving only the last element to the position of the removed.
> 
> If order preservation, is, in fact, part of the intended interface,
> then shouldn't the new function be named like '..._ordered_remove'
> to reflect that?
> 
> Alexander
> 

I see dynarray works similar to c++ vector container and the remove
usage on subsequent patch expects order preservation.  So I would
prefer to use the other way around your suggestion: to add a
unordered_remove if the case.


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

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 13:09 [PATCH 1/3] Refactor Linux ARCH_FORK implementation Adhemerval Zanella
2018-02-07 13:09 ` [PATCH 2/3] dynarray: Implement remove function Adhemerval Zanella
2018-02-07 14:48   ` Alexander Monakov
2018-02-07 16:06     ` Adhemerval Zanella [this message]
2018-02-07 13:09 ` [PATCH 3/3] Refactor atfork handlers Adhemerval Zanella
2018-02-07 15:07   ` Florian Weimer
2018-02-07 17:16     ` Adhemerval Zanella
2018-02-08  8:32       ` Florian Weimer
2018-02-08 12:50         ` Adhemerval Zanella
2018-02-20 11:29           ` Florian Weimer
2018-02-20 13:00             ` Adhemerval Zanella
2018-02-20 13:05               ` Florian Weimer
2018-02-20 13:27                 ` Adhemerval Zanella
2018-02-20 13:42                   ` Florian Weimer
2018-02-20 13:48                     ` Adhemerval Zanella
2018-02-20 13:58                       ` Florian Weimer
2018-02-20 14:23                         ` Adhemerval Zanella
2018-02-23 10:41                           ` Florian Weimer
2018-02-23 12:10                             ` Adhemerval Zanella
2018-02-27  8:25                               ` Florian Weimer
2018-03-07 16:51 ` [PATCH 1/3] Refactor Linux ARCH_FORK implementation Adhemerval Zanella
2018-03-08 12:05 ` Florian Weimer
2018-03-08 12:58   ` Adhemerval Zanella

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=f54369de-8bd1-4ed1-b5a0-dadc860bedba@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=amonakov@ispras.ru \
    --cc=libc-alpha@sourceware.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).