1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: NDArrayPool::alloc failing |
From: | Phil Atkin <[email protected]> |
To: | [email protected], [email protected], [email protected], [email protected] |
Date: | Wed, 3 Aug 2016 10:09:45 +0100 |
Thanks Ulrik, I'm not sure how much time I'm going to be able to spend on this, and I'm not so familiar with Git that this would be straightforward in any case. I'm probably going to take a conservative approach to this and accept some limitations in the way my IOC behaves. Thanks to everyone for their suggestions. Cheers, Phil On 02/08/2016 10:09,
[email protected] wrote:
Hi, This rings a bell. A while ago I started to do something like this. My idea was to better support cameras/drivers that want to manage the image memory (and avoid superfluous copies). A callback can be registered and you can decide whether to re-use or free the memory. It does not address the issue of some plugins holding on (forever?) to their latest received image - but I think that's a bit of a naughty behaviour... The commits are rather old and would need to be rebased on top of the latest ADCore master branch... https://github.com/ulrikpedersen/ADCore/commit/3e2910680b5d65ffb881304cff49cf568f13e80c and https://github.com/ulrikpedersen/ADCore/commit/db7199a110d203c7712b66ac925145ffb54b5966 Cheers, Ulrik -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mark Rivers Sent: 29 July 2016 17:39 To: 'Michael Davidsaver'; [email protected]; 'Phil Atkin' Subject: RE: NDArrayPool::alloc failing Hi Michael, This is an excellent suggestion. Phil, this should solve your problem. Your driver will get a callback when the array has been released. You can then do what you want with the buffer pointer, being confident that no plugin is using it. If you want to implement it in NDArrayPool and NDArray you can then issue a pull request on Github. Mark -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Michael Davidsaver Sent: Friday, July 29, 2016 9:37 AM To: [email protected] Subject: Re: NDArrayPool::alloc failing On 07/29/2016 09:29 AM, Mark Rivers wrote:We could add an NDArray::getReferenceCount method. If you have the array reserved and getReferenceCount=1 then you can be sure all the plugins have released it.A good interface to handle this sort of situation would be for NDArrayPool::alloc() to accept a callback function pointer to "cleanup" the user provided buffer when the NDArray ref. count falls to zero. --
![]() |