From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id CF70746CA9 for ; Sat, 7 Oct 2023 21:03:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0564168C966; Sun, 8 Oct 2023 00:03:48 +0300 (EEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A4BE68C83C for ; Sun, 8 Oct 2023 00:03:41 +0300 (EEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1c60a514f3aso27322275ad.3 for ; Sat, 07 Oct 2023 14:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696712618; x=1697317418; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YkkAgZ6DqFvNAH9UIF2BDPMqZ2FrBRUfVo0hC6/8PdY=; b=NJT1SoZMoTLjKwbcOGbkSu5zcrWwdN90cAdrWVgcYs+sjPzQiPyCjgPmdIRSVwJ6E6 61UHfJMg1VX3m6bMRdDEoD5GNatYG2XBfIDxQfcpb0N0ejYoeh1j/9egErFhvBz9wcZR DOq2y8goKldhNJ+Vc42DM7njd6vBrNSrghWCo4banVJX/uvONUHBaWVxB4Mjw/QzGlql yNwCfSvVSqXPvVBdU/oGInRQ6uxHw3oEDiYThaRbx+o7HcN0NuXiKgEnL71TcZ6tmi3O 9pEIMchJB0XANLKxnhUSZPwUy6lLRcN8iPaDSJCN/EhjeTsHce7Sr9hX4YPzB5KMOloC adgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696712618; x=1697317418; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YkkAgZ6DqFvNAH9UIF2BDPMqZ2FrBRUfVo0hC6/8PdY=; b=KaIa9CKFXjLgYVH35osKei4xIMMLUW1U/FX4lF4SdOgDHFMN5qoU3qkngBmHaRRYTN kpuaRPJhmiBaCDf/xRBv6iRAttqV23eQ6ICMcusGsqRD4O1ySDUFo5sw390UcYLgAkwU 4pHzGe4LPOJ6Jb6D84hBKfP51a1p8ixUOZOgNyK6LCORjovE5sI0lUpzbv4QBHlV6JSs Fi4RlyKLzTzejI/dtSHqze3VEqcuSpFGXsGjcVDJE1WXe3prf0qlx8XxpJ5tkpF7RNk9 OwwksBY09E9f6Lj7Ke8xhRbyrItxEeL4XfhBp8KlAmEDrmf76BB3lwMubatL+faym5yw 4m2w== X-Gm-Message-State: AOJu0Yx7IFvwy7cDeNKj+4td7TqmEwFzV4eU5DxcWfXR5zcMgT/rPDgM 9sr0wM43uwyVKIQlw+QXAViutCLCdHY= X-Google-Smtp-Source: AGHT+IE24ZDpq9w20ZZyNsGtoHpoMW6Z5rCVsGJJm4UC4B8j9+CQ2luxPKDABO00ngQdMUIUoZ8F7w== X-Received: by 2002:a17:902:da88:b0:1c3:ed30:ce0a with SMTP id j8-20020a170902da8800b001c3ed30ce0amr15115569plx.19.1696712618354; Sat, 07 Oct 2023 14:03:38 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id jg14-20020a17090326ce00b001c62b9a51a4sm6360918plb.239.2023.10.07.14.03.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Oct 2023 14:03:37 -0700 (PDT) Message-ID: <5bd4a38c-bab1-423c-b7c1-66a516763df0@gmail.com> Date: Sat, 7 Oct 2023 18:03:55 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer Autocrypt: addr=jamrial@gmail.com; keydata= xsBNBFjZtqABCADLW+vdEoZaJZDsIO6geYFTOcn1unsEHefj9zn+3oTHlDFFzO47mzHsSfbK 9JE2xpOJEVnC8FAF5Sayi/pVwV+mtQUV3n5dgVeVBYF9GUQwOGFCpK8X54RRqhkgknbunOEE 0CtgAJgmpFmmmHgq02GvEspx1h/rh4apqwQR6QX4Favb+x9+i9ytVpwVcBX94vo2toyP7h/K BWfadQmb8ltgE1kshfg+SQs/H5bTV5Z1DuEASf02ZL/1qYB/sdTgWPLv9XMUHHsRFmMY8TMx wJSkP+Af3AiYQPJYz1B1D4tt98T/NoiVdin10zATakPjV8hXaobuRmxgakkUASXudydDABEB AAHNH0phbWVzIEFsbWVyIDxqYW1yaWFsQGdtYWlsLmNvbT7CwJIEEwEIADwCGwMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheAFiEEd1EujP2UoWlX5pp6FGMBrXN2WeAFAmJoLUUCGQEACgkQ FGMBrXN2WeAFVQf9GtGhniRs1PzNUOgJktCnv6j4BbLieaIPYPEFXKDHOgjqQE2zVMYXnoXl Jam928ii902a8OY06r9ywn/R8ApD1/3NY/v64O71CY9scz5XyH2au8wIZ6HwFy3/f7sqjdGD uctY8Qs7rjT7NkoC5lmgMu2v2k03dGtM9AAf5AK5gU+H0EUw7vmKKiXzUqt5kvBuf4CEwXvH AQT1SMJ52rIlDWB7FQFyZeUbOAK2IgY/KNedfK6nsgd/eQVnlofPd2XoddE7kP6iys7jJefw DD3g3rZyDTq7in5dyk5glaNpWZpbHGBs+9SCYLnfQ8XvWqPFOD+gj0plamKANgOvavKTxM7A TQRY2bagAQgA69YtILj8kYxmqPr/M8+MXT7wVoOWVW9lvSmPquCELaDy/NIS7D06VC5EuE/6 JlJXZMTn37NLlyWhzwOgXuXw5w2tyoQQBuvqGiXJijuXwXH7HKdzrc6rpYtAqt5w05hzNrFS KrS0izG64VpWrfproy3BsL+8TBm9brLhhNPynVRqVukbbGzlATTzNQGZ14TTi2/dL6DkMQnM qn4jX9UEe4GdGQBP50bUJSSmeiIkyNLWA+znuN2PZEz930ZwNrF9GtDVw7mzcmpCZ7spldE2 tutbpy9D1bIqxyqBrYDSezyzL2adR1qgHyOTMCHg2AYNkrIQHrSyJxKTpZ1/hqOp8wARAQAB wsBfBBgBAgAJBQJY2bagAhsMAAoJEBRjAa1zdlnghekH/0Yb0iYJ74oID2f/Fj+AJKS2ekQF P2xOr8lpGzgp/+yWUvPtqbX0A33anBJdYwxaAC0NataX3tfZ+oJkzXqfmqhIHMPYHdZesJA2 Bk9hU/33mDl5s5U66/z0uelWzwKVHoQ2O6or4+qF3HJFSJLCe9uvWJ3zXf9F342Ftj73sfx+ 3xkw/IXsN1RqbYqDlzpoEQ99SIEfY/8Jjwnd3sIPfqkuyeaYfe6GJDqKawdCEP1oRRlbXEAp TJgYz8r3nPhGv9cdHNDCk44ISbsqVuxIEnLqi4fTPZaGupiQhT+srl268TTAp2TQW7+6Ce/b NPQorMquzS/LZoyALpmsYi/miMc= In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 02/42] avcodec/refstruct: Add simple API for refcounted objects 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 9/19/2023 4:56 PM, Andreas Rheinhardt wrote: > + > +/** > + * Allocate a refcounted object of usable size `size` managed via > + * the RefStruct API. > + * > + * By default (in the absence of flags to the contrary), > + * the returned object is initially zeroed. > + * > + * @param size Desired usable size of the returned object. > + * @param flags A bitwise combination of FF_REFSTRUCT_FLAG_* flags. > + * @param opaque A pointer that will be passed to the free_cb callback. > + * @param free_cb A callback for freeing this object's content > + * when its reference count reaches zero; > + * it must not free the object itself. > + * @return A pointer to an object of the desired size or NULL on failure. > + */ > +void *ff_refstruct_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, > + void (*free_cb)(FFRefStructOpaque opaque, void *obj)); > + > +/** > + * A wrapper around ff_refstruct_alloc_ext_c() for the common case > + * of a non-const qualified opaque. > + * > + * @see ff_refstruct_alloc_ext_c() > + */ > +static inline > +void *ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, > + void (*free_cb)(FFRefStructOpaque opaque, void *obj)) > +{ > + return ff_refstruct_alloc_ext_c(size, flags, (FFRefStructOpaque){.nc = opaque}, > + free_cb); > +} > + > +/** > + * Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL) Why is this not inlined, then? > + */ > +void *ff_refstruct_allocz(size_t size); _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".