From patchwork Sun Nov 18 14:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 11066 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B36A744BF0A for ; Sun, 18 Nov 2018 16:09:46 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DF55680399; Sun, 18 Nov 2018 16:09:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CDDAB680352 for ; Sun, 18 Nov 2018 16:09:39 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id u5-v6so24005594wrn.9 for ; Sun, 18 Nov 2018 06:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i5G6nw7BqYM4dR7KHpp7TusfI8DRe8fiE8zL98CzP7o=; b=likvoOZLAugUDaqj7xTFR32sxaU4NEt6DfETO8htAv5PHo9wfBr8KTAC92Vu74Fc+B Nt9TFS4K8n9wPQQwwY7jDRlO1kuDL5aLhihSK/Ui5Jb1Eb0FAA3kf94xfxz0rFS8xZIq /FjQZJeRX7+73nPZMnNxJcc+eBa+58FRbEBQ5DPmNA+Tj4mOy61eHkOhEG/aQBKt1P9b np6guKnbXKC1w3p2tp3x1Odd3PoLV1qFg8Z5KvSylYoIgNsI70rOmBfW1Xw6bJwFn5+M 5hXNU4aUOm3ZfJFYBRC5zyrNuSmXicrLmi5MUf7ipATlZQkKnWYSs63wGStrfBbdil7H Y6QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i5G6nw7BqYM4dR7KHpp7TusfI8DRe8fiE8zL98CzP7o=; b=QsatHEjs555nT21qoGSKjYRKUhrK2ktU2RtGJlN8GQ1ZTMgV4LLyD3RsLIXan3pu5g NZeLAYgVWLQEmU3pYyhIaaX9PGUHZZuQDOZ+6x8r7ZYoKeondyKLBla7+L38crwzAJmI M4BE3uhICz18MB9p9MIp48aj1FGE66YZg3NPiPojvTADDeKJ0zSvZdY8XtVglJt9sPDJ ycQLz72LbUrk9HZuJrZSdutjvb1fDsh0jmE5CF+SvSZT6LeyXcumiB1DGy8A3dapLqY6 geEW8kozIyHMjk+rOW5NYCxUcTEsFTkRVud4pbN7c36WNsnrCUxTutuZeGCwyMGt8vyS yHew== X-Gm-Message-State: AGRZ1gJ9f6q/26cLNV3EUD/QvZTU0rKvAbM9XY6G3OFg0M1Bqu8qGYf7 FX8Kkno1xQhULZUzZPPEyAxcxNAx X-Google-Smtp-Source: AJdET5evVzmi2yXq7lt4RPlBdUzoxfdgn72c2A8CWmDx7E/m3zFPhGDcLl/s970wTpSYevyq+Gbdeg== X-Received: by 2002:a05:6000:11cb:: with SMTP id i11mr15108782wrx.234.1542550179979; Sun, 18 Nov 2018 06:09:39 -0800 (PST) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.googlemail.com with ESMTPSA id m65sm4532590wmb.4.2018.11.18.06.09.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Nov 2018 06:09:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Nov 2018 15:08:45 +0100 Message-Id: <20181118140845.2488-1-andreas.rheinhardt@googlemail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/mem: Correct documentation of av_fast_*alloc(z) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The current wording regarding size and min_size is completely wrong and ignores that min_size is indeed only a desired minimal size, not the actually allocated size. Signed-off-by: Andreas Rheinhardt --- libavutil/mem.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libavutil/mem.h b/libavutil/mem.h index 7e0b12a8a7..55ae573ac9 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -363,10 +363,10 @@ av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); * @endcode * * @param[in,out] ptr Already allocated buffer, or `NULL` - * @param[in,out] size Pointer to current size of buffer `ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `ptr` + * @param[in,out] size Pointer to the size of buffer `ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `ptr` * @return `ptr` if the buffer is large enough, a pointer to newly reallocated * buffer if the buffer was not large enough, or `NULL` in case of * error @@ -397,10 +397,10 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); * @param[in,out] ptr Pointer to pointer to an already allocated buffer. * `*ptr` will be overwritten with pointer to new * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` + * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `*ptr` * @see av_realloc() * @see av_fast_mallocz() */ @@ -418,10 +418,10 @@ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); * @param[in,out] ptr Pointer to pointer to an already allocated buffer. * `*ptr` will be overwritten with pointer to new * buffer on success or `NULL` on failure - * @param[in,out] size Pointer to current size of buffer `*ptr`. `*size` is - * changed to `min_size` in case of success or 0 in - * case of failure - * @param[in] min_size New size of buffer `*ptr` + * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is + * updated to the new allocated size, in particular 0 + * in case of failure. + * @param[in] min_size Desired minimal size of buffer `*ptr` * @see av_fast_malloc() */ void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size);