Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: waveform record: how its VAL get data? any potential memory leak? ...
From: Jack Smith <jacksmithvent2009@gmail.com>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 25 Oct 2012 23:31:22 -0400
Hello everyone,

I'm looking through the source code of the waveform record and trying
to understand how the it works. A few questions:

1. How does the BPTR field transfer data to VAL? Why do we have to set
NORD in the device support?

2.  During the record initialization, there is memory allocation by
callocMustSucceed( ). I remember some programming experts claim that
malloc (or new) must be paired with free (or delete) in a program to
prevent memory leak. If that is true, how should we deal with this
allocated memory in the lower level such as device support or driver
support to prevent memory leak? If I type "exit" to kill a Linux IOC,
will the memory allocated to the waveform record be released
automatically so that there is actually no memory leak problem?

3. When I look at waveformRecord.dbd, the field type of both VAL and
BPTR is DBF_NOACCES which I guess means no access to this field from
the database outside. It's true that I can't camonitor
waveform-record.BPTR, but obviously we can camonitor
waveform-record(.VAL). So, why does the DBF_NOACCES affect the VAL
field and the BPTR differently? What kind of magic makes VAL
accessible while BPTR inaccessble?

Thanks,

J.S.

Replies:
RE: waveform record: how its VAL get data? any potential memory leak? ... Hu, Yong
Re: waveform record: how its VAL get data? any potential memory leak? ... Michael Davidsaver
Re: waveform record: how its VAL get data? any potential memory leak? ... Tim Mooney

Navigate by Date:
Prev: Re: Lambda EMS mismatch errors Eric Norum
Next: Re: what are your definitions of softIOC and soft record? Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
Navigate by Thread:
Prev: Re: mbboDirect record initialization Michael Davidsaver
Next: RE: waveform record: how its VAL get data? any potential memory leak? ... Hu, Yong
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·