﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
57	Store deallocator in memBlock	robert.desonia@…	eugene	"To ensure that the proper ps*Free function is called for any given pointer, I
propose that, at the time of allocation, a pointer be set in the memBlock for
the cooresponding ps*Free function.  The user, then, need only ever use psFree
and psFree could call the ps*Free function required, if any.

I propose the addition of two functions: 

  void p_psSetFreeFcn(void* ptr);     
  ///< sets the fcn pointer to the appropriate ps*Free function.  If NULL,
  ///< then a generic free functionality is used (i.e., the old psFree
  ///< functionality).

  freeFcn p_psGetFreeFcn(void* ptr);
  ///< retrieves the function pointer to the higher-level free function to be
  ///< used.  If NULL, then the traditional psFree functionality shall be used.

All ps*Free functions could now be private, and psFree would be the sole means
for users to free any pointer generated by psLib.  These functions need to all
have the same prototype.  I suggest it be the same as p_psFree, i.e., containing
the file and lineno of the originating call (psFree would pass that along when
it invokes it).

This also solves issues with the reference counter, as psMemDecrRefCounter would
be smart enough to properly free complex containers as well as simple buffers
from psAlloc."	defect	closed	high		PSLib SDRS	unspecified	normal	fixed		rhl@…
