From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: [PATCH 2/3] dynarray: Implement remove function Date: Wed, 7 Feb 2018 17:48:09 +0300 (MSK) Message-ID: References: <1518008967-8310-1-git-send-email-adhemerval.zanella@linaro.org> <1518008967-8310-2-git-send-email-adhemerval.zanella@linaro.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1518014821 16646 195.159.176.226 (7 Feb 2018 14:47:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Feb 2018 14:47:01 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) Cc: libc-alpha@sourceware.org To: Adhemerval Zanella Original-X-From: libc-alpha-return-90104-glibc-alpha=m.gmane.org@sourceware.org Wed Feb 07 15:46:57 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version:content-type; q=dns; s=default; b=I0fvJ BplPoJ3mxJxwVyZesILoyew+HNREFY82lINCGsAVkTC6xayH6PFFwbBZ7jSfhGXm sSoTF9xt65BMCQsXyrwh12Z0ks3Pi9PKXqFs3RoI8I+L6j9EdHfNf2ySmwXLa1Ge rBr7+HM+MFWGW8XAQe3j8oryUbZXPP7xW1zMmU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version:content-type; s=default; bh=HzPdw6jTymg e6/7G0TZhn0m9SWs=; b=IY2QZcEH8f0qI3fa1emSw3QjJdRfIEnPW6vI4Zy8XLq DjQ+E0f0DcbawUVYW0vvJ4cXvXmuyyv3Gb//HMX+ZdU45JmFASiAaAq612WdSH5g 2VceNvMfMStXZqIuFFvzQ3nBZDhKffyQe6QCLIYF1Bd8Ub0NcO6TnHZmR/1c6Dyo = Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.ispras.ru In-Reply-To: <1518008967-8310-2-git-send-email-adhemerval.zanella@linaro.org> Xref: news.gmane.org gmane.comp.lib.glibc.alpha:82452 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejQze-000363-Pv for glibc-alpha@blaine.gmane.org; Wed, 07 Feb 2018 15:46:39 +0100 Received: (qmail 107045 invoked by alias); 7 Feb 2018 14:48:40 -0000 Received: (qmail 106969 invoked by uid 89); 7 Feb 2018 14:48:24 -0000 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