Privacy and Security Notice

Archived Messages for CDEV_1997@cebaf.gov: Re: leaks in cdev 1.6

Re: leaks in cdev 1.6

Walt Akers (akers@CEBAF.GOV)
Mon, 30 Jun 1997 12:24:05 -0400 (EDT)

> Howdy,
>
> Is there any way to retrieve the array of string pointers without
> incurring the overhead involved in allocating memory for each
> individually (so that the caller can use his/her own allocation
> and placement routines)?
>
> Chris

Yes. You can use the cdevData::find routine. This will give you a
pointer to the actual data item that is stored in the cdevData object.

There are certain challenges that are involved with using this approach.

1) You have to use the cdevData::getType method first to ensure that
you are extracting the data into the right data type.

2) You have to use the cdevData::getElems and the cdevData::getDim
method to determine the configuration of the data.

3) If you modify or delete the pointers that are retrieved using the
cdevData::find method you will upset the balance of the universe
and your application will very likely be destroyed by thunderbolts
from heaven.

Walt

--
=============================================================
Walt Akers Voice: (757)269-7669 E-Mail: akers@cebaf.gov
Thomas Jefferson National Accelerator Facility
12000 Jefferson Avenue, MS 16A
Newport News, Va 23606
=============================================================