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.
- Replies:
- RE: NDArrayPool::alloc failing ulrik.pedersen
- References:
- NDArrayPool::alloc failing Phil Atkin
- RE: NDArrayPool::alloc failing Mark Rivers
- Re: NDArrayPool::alloc failing Phil Atkin
- RE: NDArrayPool::alloc failing Mark Rivers
- Re: NDArrayPool::alloc failing Michael Davidsaver
- Navigate by Date:
- Prev:
RE: NDArrayPool::alloc failing Mark Rivers
- Next:
RE: shell command in medm Mooney, Tim M.
- 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
- Navigate by Thread:
- Prev:
Re: NDArrayPool::alloc failing Michael Davidsaver
- Next:
RE: NDArrayPool::alloc failing ulrik.pedersen
- 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
|