Ralph,
My first comment is that I am fixing all bugs and deficiencies
in the GDD code as they are discovered. This unfortunately has been a
significant effort. In the long term we have prepared a vastly simpler and
more efficient alternative to GDD which we intend to support in parallel to
GDD via a new base class for class "casPV".
>
> 1) For easy-to-use and fast gdd assignments, the operator = is
> overloaded in gddI.h to use memcpy().
>
> (I thought memcpy() was the default for operator =, but anyway.)
>
> When this operator is used to assign gdds that are container
> members, the pointer to the next element is included in the memcpy()
> and screws up the member lists of both containers.
This bug appears to still be in the version in CVS. Will you be committing
a fix to the main trunk?
> The frequently used gddApplicationTypeTable function to create
> standard gdds returns a gdd*. So using operator [] will do regular
> pointer arithmetics and not use the overloaded operator.
>
> Even if you use a gddContainer* (through a dangerous cast) the
> overloaded operator [] takes an unsigned int as index argument
> whereas the constants defined in gddApps.h are signed.
The version committed to CVS appears to have overloaded [] operator in class gdd
for both integer and unsigned indexes. These operators should also be in class
gddContainer since it publicly derives from gdd. I created this patch last spring
but it appears to have been committed to CVS in August of last year. NOTE THAT
IN C++ THE OVERLOADED [] OPERATOR WILL BE USED ONLY IF YOU ARE DIRECTLY ACCESSING
THE OBJECT OR USING A REFERENCE TO THE OBJECT. THE BUILT-IN [] OPERATOR IS ALWAYS
USED BY C++ WHEN A POINTER IS ACCESSING THE OBJECT.
>
> New standard gddContainer objects (created using the AppTypeTable)
> are always malloc'd as one contiguous block, so pointer arithmetics
> will work. By chance.
In Jim's nomenclature a container GDD can be "flat". If it is flat the
container is just a linear array of GDDs that can be indexed with the default
C++ [] operator. Last spring I found a nasty bug where internally GDD's "dbMapper.cpp"
was using the [] operator, but not checking to see if the container was flat. My fix
was to overloaded the [] operator so that the behavior is different when the GDD
container is scattered around in memory and accessed as a linked list, and therefore not
"flat". The performance will of course be abysmal, but at least we can get reliable
operation in all situations. This fix is committed to CVS.
> (... live from the coding dungeon)
>
Join the club. I have been stuck with the GDD dungeon since Jim left.
Jeff
- References:
- Fatal GDD deficiencies Ralph . Lange
- Navigate by Date:
- Prev:
Channel Access for Macintosh? Steve Lewis
- Next:
GPIB Devices Robert Willson
- 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:
Fatal GDD deficiencies Ralph . Lange
- Next:
Channel Access for Macintosh? Steve Lewis
- 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
|