From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1076FC433EF for ; Sat, 9 Oct 2021 01:38:30 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 106FD60EE7 for ; Sat, 9 Oct 2021 01:38:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 106FD60EE7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 077128362B; Sat, 9 Oct 2021 03:38:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Zf6hT5QQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA26883625; Sat, 9 Oct 2021 03:38:18 +0200 (CEST) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C442B83622 for ; Sat, 9 Oct 2021 03:38:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x736.google.com with SMTP id l7so11388717qkk.0 for ; Fri, 08 Oct 2021 18:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SUOTWMmCGJelwdLNsvFUnU3mJn3NVDR9Ew0NlZ51qvQ=; b=Zf6hT5QQEmhnV5XXGhFPFeH/fXmXexNjqMu8mGXk53v6b2pOTizn9wmrBzhhDlUlhr o5T00uU96FIKD4Ltlp550hfpVXIuxdM647IGZFeNip5njHA2Z17h3RxEvRczvHCtHb3b p1k1uCOND0kTCU+wFUAGE230Lw60E6jaywJ+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SUOTWMmCGJelwdLNsvFUnU3mJn3NVDR9Ew0NlZ51qvQ=; b=j2RG383vKOknppqn4p8Tx7m0EeLwXveD8v74pdRQzxtksbdQ/DoY972WkRfFQsFEQ6 QsrXtJUeEr/VGiPHHuoSjwEFGx4Fa7SBh1/adOCnVH16VssKdVSri8Yla5w0bdEibKTW V87VZsSQ9XaKFIwr5i6FBQR+8oaz0EkmS6p66vD2U8tUKVlELDEzHPBuXNWgr5Pr1LVL sgIToWEVZ+DCj3aB4qoEt5dfGyz48B2Ba9h40U7uPRFe9RwOcMRZ1BT3aN+zz/mml9+L /CuYWYzAx7yGFSDINUiZxMj990x7Zfn6CULSFG9XEAiTfW069jmhFBtuD6T/mEVyeNQ1 +FHg== X-Gm-Message-State: AOAM532NFPBbXV8GL8z2bHWkkK6A2JZqfQHKr34UrgD34d2C7Ly9E5z7 ij4XrJOx5c4unQ7de/5d3AV9hA== X-Google-Smtp-Source: ABdhPJxqOPf0KbU9DJRYxrqcMwpXzFu4sespn1q38O/xqXJydGB1S9/jgF3gSVkFy2eALUrhKU82ag== X-Received: by 2002:a37:44cc:: with SMTP id r195mr5933225qka.77.1633743490303; Fri, 08 Oct 2021 18:38:10 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-1c00-ef41-79c3-ef5b.res6.spectrum.com. [2603:6081:7b01:cbda:1c00:ef41:79c3:ef5b]) by smtp.gmail.com with ESMTPSA id z6sm798253qke.24.2021.10.08.18.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 18:38:09 -0700 (PDT) Date: Fri, 8 Oct 2021 21:38:08 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Heinrich Schuchardt , Alexandru Gagniuc , Bin Meng Subject: Re: [PATCH v4 02/15] Add support for an owned buffer Message-ID: <20211009013808.GB7964@bill-the-cat> References: <20210925130320.7824-1-sjg@chromium.org> <20210925070255.v4.2.Iac016f2b531889277f63e4999494a967a823659b@changeid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4bRzO86E/ozDv8r1" Content-Disposition: inline In-Reply-To: <20210925070255.v4.2.Iac016f2b531889277f63e4999494a967a823659b@changeid> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --4bRzO86E/ozDv8r1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 25, 2021 at 07:03:07AM -0600, Simon Glass wrote: > When passing a data buffer back from a function, it is not always clear > who owns the buffer, i.e. who is responsible for freeing the memory used. > An example of this is where multiple files are decompressed from the > firmware image, using a temporary buffer for reading (since the > compressed data has to live somewhere) and producing a temporary or > permanent buffer with the resuilts. >=20 > Where the firmware image can be memory-mapped, as on x86, the compressed > data does not need to be buffered, but the complexity of having a buffer > which is either allocated or not, makes the code hard to understand. >=20 > Introduce a new 'abuf' which supports simple buffer operations: >=20 > - encapsulating a buffer and its size > - either allocated with malloc() or not > - able to be reliably freed if necessary > - able to be converted to an allocated buffer if needed >=20 > This simple API makes it easier to deal with allocated and memory-mapped > buffers. >=20 > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! --=20 Tom --4bRzO86E/ozDv8r1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFg8n8ACgkQFHw5/5Y0 tywU9wv/VCmeppWQcF56xHq/ArPLBxzCTQCUPkKOr7qV1CzxfQa77EmvGJD+5c73 hfxYhEeylboNMkL10/wuMiX2exSRNJpDJGH+JHgUhQSELMS6risW/Cn3lFqpzNP1 esMBfkPJPTi6FVx5i7kZvx3kdpA3ujOm10S9Utjs1/svVdbfWS7bHkPUHzTJQaLa BnSpxj9FT9ZSSykXlVhPunoDzJdodOjcAddzu6MtnR6ZbYxjNNoC/e6qP+fLUIhx 04u2nAa6e8lvwKYQ/6n0h6sHUqSbhH8FEO9u58CXKOAR7ACESI5u5rI4YX5a4ufb ww9xr/xl5CbRA52ZPrCGOCaIcBayfDLknUChEfzssxn9gxiNBjWNNig99toRQl2p mUkTHt8Iyx5cN7rwUYYuC1xblmB/bIQizgK/7c+kMbmELtzfS7N87RSDqJOwPhEL eM3b6Sx8pyKP040TibELMTbiLpCpZci7unk+k5kwC5MNkdDKoeSKCbvyXeXrhzrP UtwEs82z =BFQc -----END PGP SIGNATURE----- --4bRzO86E/ozDv8r1--