From patchwork Sat Sep 14 00:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 51573 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9fc3:0:b0:48e:c0f8:d0de with SMTP id k3csp136609vqy; Fri, 13 Sep 2024 18:09:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU8RKC2Z5FGWUSSq9KVTRDnCmIFlGP4XCua/Ji1Zk9wkbZ4Bn4FUv9yX1MJjN3/sCQ6fQd3ySFZf2K8qRfTLX49@gmail.com X-Google-Smtp-Source: AGHT+IETehKzjDjKv8aKZSn0iaizm/ttQiZKbB2IfZ6bVILhxki40wM75CSLzxf2DuQJE36BiePl X-Received: by 2002:a05:6402:51c6:b0:5c2:5df4:5a4c with SMTP id 4fb4d7f45d1cf-5c41e2af39dmr4554937a12.33.1726276151891; Fri, 13 Sep 2024 18:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726276151; cv=none; d=google.com; s=arc-20240605; b=AM1Zxrl5OjstG//AShHnBasAKasR0VtX6whuqeMUF4+RALryTfy2pweHWAlB+aXVkf KtJLPYwWY9F6VA1Mknx8JLEuzPuAb5Igm4f+wtjcRjhFxkYbuE27lzr1wKyfujQw4cNF b3LTI6uhr5UT/IQltPZsiTo+czNmrYVnlblvX/dfVs6cpR3JjJvkr1ZDYkML93bbQegI /I60nh3FZupLWZLf3xcPOWwNnHQn9meXAB71OIkeNUpKq+sanQea0n/rKOzzMak2MGvl tawAfMH7k8oVjh3gyfratPyPcNflBAQTklMfp3XGu5CdHWVGH3KYS/7pWUAV7d9HuJz7 df3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=2Jacpm3nKgexlu7Nh3zt9QNGC9Kqok0sue6v0f6yqn4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=dydLgYaFYMu4xOgP97Oi+54qYZWwDixXzBTw9mg7teitVVilPDKkvu4Cen3B/1IAH7 BTpHuub35joHhRsRhw3Q5+5HwwtJVhk0iUKx/2zMK9KN30lWwsuEVdcXpdQZQ6yMCM5E y1+weeG5vLb+MOGCLzDLfNhQPEKRUPrB6r1walFGpZUNIL4Ou+Jxy4CrTjQzfi6NVrpQ KxS49hqTqk9ExXmccWY6Rk4Y8VDRPsPQQE6XaS9Rn1FWpJjsX1YEw9hZnUdhNUGheOzO IUHPb4Cf0yrAH55WHWUzvmSzlbk9iSXdHviLZUihVHONjbCWwckeALsJpVwlUCQmM7Od e+7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=LgJLIutq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a90612f099esi23939866b.679.2024.09.13.18.09.09; Fri, 13 Sep 2024 18:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=LgJLIutq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 54BA068DF57; Sat, 14 Sep 2024 03:44:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 249CA68DBEA for ; Sat, 14 Sep 2024 03:44:43 +0300 (EEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20570b42f24so29978855ad.1 for ; Fri, 13 Sep 2024 17:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726274680; x=1726879480; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=OH+zWOyK5O0sSbaCkQG3Ey6l8Za9J9ZAwx8RKhCClGo=; b=LgJLIutqR8mBYnve3PKY3V0/OoCWV5ObXqJZEDhYxwY/Tcze+owjYTC4ouOVnss2wu ZY8fI6ODYcx3BhyIWpRdBq6mjLKyLzeCakL6/OKvIQBeE/PDETXF63OFlzeVK0egfAx4 zbWUWv36U1iF7YR8yvMRimGZKg6nUS1scztbXcFOxymVSPiTSw1aW/CCEGtHfHExa9+A L9eA/xCE79Glk2qDZ7C3EXLS4sVbT31qBNfsrXrH4Kd8QcBW7r7UyHab6O5cmQ7y4wc+ hfVtXU1KehlnmS0cheLgoNSZPw1WJrknwvA/68I3wiLqirEUfGSNkJ+nZkhuWTCGLTBb P47A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726274680; x=1726879480; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OH+zWOyK5O0sSbaCkQG3Ey6l8Za9J9ZAwx8RKhCClGo=; b=HBmTioG4P8NaFTDBCfHGRvYFIeKg6DO84AUkbRSazDYOBAUHPxYzT/E19Hr8GSxxzN f0J/OfK8IyK8cq+us8LzqLRP2Zztl7V5MKTBwHVjC0qz01LpxUIICLuPP7a08nfJc1C5 OOYvlN7GNF3SXMlAIY2ymYQRw6tpDyH5cJMzCGA1ULsyN1j8CGWP3f9J1dt/iqjSPG5r lBPAezXyxmrToLMbDqkMVQfRVQ6gZnJQ6Byp++c5uQpPSmLvG2XGJ9TGu1KXjupfEDu9 O1+BehfqrIFlFstmAM51TV6eqUFReI5AX9Ggkx312nCH96ipEJNRveNnFvsmQ7kfRQa3 1bXQ== X-Gm-Message-State: AOJu0YwJIE8HBqTLR2MdFrF3etojLNv/WxpqvN0Imnb5aMTtPSgMYO7/ MkFlGRIgOMKx8COsgzXdSwx/S9qRqZ0SjjaVUdRNO83h9cWxZHQuctgDiw== X-Received: by 2002:a17:902:e5c5:b0:1fc:6cf5:df4b with SMTP id d9443c01a7336-2076e428114mr134504555ad.49.1726274679703; Fri, 13 Sep 2024 17:44:39 -0700 (PDT) Received: from localhost.localdomain ([181.92.233.116]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794602c3asm1860635ad.92.2024.09.13.17.44.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 17:44:38 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 13 Sep 2024 21:44:34 -0300 Message-ID: <20240914004434.6368-1-jamrial@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/refstruct: inline ff_refstruct_pool_alloc() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: P59/RbNVV/Lq Much like ff_refstruct_pool_alloc_ext(), it's a wrapper around ff_refstruct_pool_alloc_ext_c(). Signed-off-by: James Almer --- libavcodec/refstruct.c | 5 ----- libavcodec/refstruct.h | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/libavcodec/refstruct.c b/libavcodec/refstruct.c index f89af156c2..13778f3f58 100644 --- a/libavcodec/refstruct.c +++ b/libavcodec/refstruct.c @@ -332,11 +332,6 @@ static void refstruct_pool_uninit(FFRefStructOpaque unused, void *obj) } } -FFRefStructPool *ff_refstruct_pool_alloc(size_t size, unsigned flags) -{ - return ff_refstruct_pool_alloc_ext(size, flags, NULL, NULL, NULL, NULL, NULL); -} - FFRefStructPool *ff_refstruct_pool_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, int (*init_cb)(FFRefStructOpaque opaque, void *obj), diff --git a/libavcodec/refstruct.h b/libavcodec/refstruct.h index c64ad62b6b..f9cd406bf2 100644 --- a/libavcodec/refstruct.h +++ b/libavcodec/refstruct.h @@ -220,11 +220,6 @@ typedef struct FFRefStructPool FFRefStructPool; */ #define FF_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME (1 << 18) -/** - * Equivalent to ff_refstruct_pool_alloc(size, flags, NULL, NULL, NULL, NULL, NULL) - */ -FFRefStructPool *ff_refstruct_pool_alloc(size_t size, unsigned flags); - /** * Allocate an FFRefStructPool, potentially using complex callbacks. * @@ -266,6 +261,18 @@ FFRefStructPool *ff_refstruct_pool_alloc_ext(size_t size, unsigned flags, init_cb, reset_cb, free_entry_cb, free_cb); } +/** + * A wrapper around ff_refstruct_pool_alloc_ext_c() for the common case + * of no custom callbacks. + * + * @see ff_refstruct_pool_alloc_ext_c() + */ +static inline +FFRefStructPool *ff_refstruct_pool_alloc(size_t size, unsigned flags) +{ + return ff_refstruct_pool_alloc_ext(size, flags, NULL, NULL, NULL, NULL, NULL); +} + /** * Get an object from the pool, reusing an old one from the pool when * available.