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 7F83345780 for ; Wed, 20 Sep 2023 19:59:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9D59E68C8D1; Wed, 20 Sep 2023 22:59:04 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2E8AC68BDD6 for ; Wed, 20 Sep 2023 22:58:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 732FC20007 for ; Wed, 20 Sep 2023 19:58:57 +0000 (UTC) Date: Wed, 20 Sep 2023 21:58:56 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230920195856.GN8640@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 17/42] avcodec/refstruct: Add RefStruct pool API 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-Type: multipart/mixed; boundary="===============3991872702719547807==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3991872702719547807== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wTzoGrkn2AhIv4sC" Content-Disposition: inline --wTzoGrkn2AhIv4sC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 19, 2023 at 09:57:09PM +0200, Andreas Rheinhardt wrote: > Very similar to the AVBufferPool API, but with some differences: > 1. Reusing an already existing entry does not incur an allocation > at all any more (the AVBufferPool API needs to allocate an AVBufferRef). > 2. The tasks done while holding the lock are smaller; e.g. > allocating new entries is now performed without holding the lock. > The same goes for freeing. > 3. The entries are freed as soon as possible (the AVBufferPool API > frees them in two batches: The first in av_buffer_pool_uninit() and > the second immediately before the pool is freed when the last > outstanding entry is returned to the pool). > 4. The API is designed for objects and not naked buffers and > therefore has a reset callback. This is called whenever an object > is returned to the pool. > 5. Just like with the RefStruct API, custom allocators are not > supported. >=20 > (If desired, the FFRefStructPool struct itself could be made > reference counted via the RefStruct API; an FFRefStructPool > would then be freed via ff_refstruct_unref().) >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/refstruct.c | 194 ++++++++++++++++++++++++++++++++++++++++- > libavcodec/refstruct.h | 128 +++++++++++++++++++++++++++ > 2 files changed, 321 insertions(+), 1 deletion(-) seems to break building on ppc (--disable-pthreads) CC libavcodec/refstruct.o src/libavcodec/refstruct.c: In function =E2=80=98pool_free=E2=80=99: src/libavcodec/refstruct.c:187:5: error: implicit declaration of function = =E2=80=98pthread_mutex_destroy=E2=80=99; did you mean =E2=80=98ff_mutex_des= troy=E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_destroy(&pool->mutex); ^~~~~~~~~~~~~~~~~~~~~ ff_mutex_destroy src/libavcodec/refstruct.c: In function =E2=80=98pool_return_entry=E2=80=99: src/libavcodec/refstruct.c:205:5: error: implicit declaration of function = =E2=80=98pthread_mutex_lock=E2=80=99; did you mean =E2=80=98ff_mutex_lock= =E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_lock(&pool->mutex); ^~~~~~~~~~~~~~~~~~ ff_mutex_lock src/libavcodec/refstruct.c:211:5: error: implicit declaration of function = =E2=80=98pthread_mutex_unlock=E2=80=99; did you mean =E2=80=98ff_mutex_unlo= ck=E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_unlock(&pool->mutex); ^~~~~~~~~~~~~~~~~~~~ ff_mutex_unlock src/libavcodec/refstruct.c: In function =E2=80=98ff_refstruct_pool_alloc_ex= t_c=E2=80=99: src/libavcodec/refstruct.c:339:11: error: implicit declaration of function = =E2=80=98pthread_mutex_init=E2=80=99; did you mean =E2=80=98ff_mutex_init= =E2=80=99? [-Werror=3Dimplicit-function-declaration] err =3D pthread_mutex_init(&pool->mutex, NULL); ^~~~~~~~~~~~~~~~~~ ff_mutex_init cc1: some warnings being treated as errors /home/michael/ffmpeg-git/ffmpeg/ffbuild/common.mak:81: recipe for target 'l= ibavcodec/refstruct.o' failed make: *** [libavcodec/refstruct.o] Error 1 make: Target 'all' not remade because of errors. [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell --wTzoGrkn2AhIv4sC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZQtO+AAKCRBhHseHBAsP q0stAJ4lLudZyPZEDoi317frA5XjvCx24ACeIVPekyBuOI3iM65Ql71CRMmxfk0= =OhxV -----END PGP SIGNATURE----- --wTzoGrkn2AhIv4sC-- --===============3991872702719547807== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3991872702719547807==--