Disposing generic pointers

Adriaan van Os gpc at microbizz.nl
Tue Apr 6 18:06:46 CEST 2010

John L. Ries wrote:
> On Tue, 6 Apr 2010, Adriaan van Os wrote:
>> John L. Ries wrote:
>>> Since the unit in question is supposed to work with whatever data type
>>> is thrown at it (it is intended to be generic set of queuing routines),
>> But how are the queue elements allocated ?
> By the calling program.  All the queue unit ever sees are pointers and 
> its own infrastructure.

But then, I think it would be good style to add a call to the unit that does the allocation - if 
you really want the unit to be generic, as you write. After all, it is possible that the calling 
program chooses an allocater that is incompatible with the deallocator in the unit.


Adriaan van Os

More information about the Gpc mailing list