IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#708 closed defect (fixed)

Reference counters for "views"

Reported by: Paul Price Owned by: David.Robbins@…
Priority: high Milestone:
Component: types Version: unspecified
Severity: normal Keywords:
Cc:

Description

After some umm-ing and ah-ing, we have converged on a blanket policy with regard
to "views" of pointers. This policy is to be applied to all the "types" in
psLib that act as collections (psArray, psList, psHash, psMetadata).

Retrieving a pointer from a collection (e.g., psListGet, psMetadataLookup) shall
*not* increment the reference counter. The reason for this is the reduced
efficiency that comes from the increased hits on the memory management system
(especially the need to lock the mutex when working with multiple threads, as is
becoming an increasingly likely mode of operation). That is, we suffer by the
extra calls to psMemIncrRefCounter and psFree which would be required.

This does mean that we will have to be a bit more careful (e.g., of dangling
pointers --- pointers to something that has already been freed) than we would if
we went with the cautious option of having views increment the reference counter.

Functions that must be updated:
psArrayGet --- don't increment before returning

And I think that's it.

Change History (7)

comment:1 by gusciora@…, 20 years ago

Owner: changed from gusciora@… to robert.desonia@…

Robert, can you look at this and tell me who is best suited to working on it?

comment:2 by Paul Price, 20 years ago

It shouldn't be too hard --- remove the psMemIncrRefCounter at the end of
psArrayGet, and look for all usages of psArrayGet elsewhere in the code and
remove the associated psFree.

comment:3 by jhoblitt, 20 years ago

blocked: 717

comment:4 by gusciora@…, 20 years ago

Owner: changed from robert.desonia@… to David.Robbins@…

comment:5 by David.Robbins@…, 20 years ago

Resolution: fixed
Status: newclosed

removed psMemIncrRefCounter from psArrayGet. Removed corresponding psFree's.

comment:6 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:7 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.