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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | NDArrayPool::alloc failing |
From: | Phil Atkin <[email protected]> |
To: | [email protected] |
Date: | Thu, 28 Jul 2016 18:13:38 +0100 |
In my areaDetector plugin I'm calling this method in one of two
ways, depending on a PV value:
All seems to work well when operated continuously in either mode,
but I see a crash in RtlFreeHeap when I process at least one frame
in the first mode, and then switch to the second. This does not
happen if I perform the same sequence of steps but instead of
passing the pData to my buffer, I pass null and then copy from my
buffer to the output - but this is a large buffer so I'd like to
avoid this. I haven't found anything in the documentation that says as much
but I had assumed that, if I pass my own buffer to alloc,
NDArrayPool would regard me as its owner and would never try to
deallocate it. (I would also expect it to exclude my buffer's
size from its allocation limit calculations, but that's a
secondary concern). However, that appears not to be the case:
NDArrayPool::alloc is deciding to free a now-unused NDArray that's
pointing to my buffer and so it's calling
free(freeArray->pData); that's failing because the memory was
allocated in a manner incompatible with free. NDArray seems to
contain nothing that indicates who allocated the buffer, so
NDArrayPool cannot reasonably alter its behaviour accordingly. This behaviour doesn't seem right to me (on general principles) -
but maybe I've misunderstood how I'm supposed to use this API? Phil --
Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP |