GPC and Mac implicit pointer objects
Peter N Lewis
peter at stairways.com.au
Sat Jul 2 05:06:38 CEST 2005
At 12:36 +0200 1/7/05, Frank Heckenbach wrote:
> > Lack of univ parameter support (I see Sun Workshop Compiler docs
>So what do you really need?
Every use of univ in the Apple Universal Interfaces is a pointer
(they are all just Ptr, but that is unsurprising since they don't
specify the implementation anyway, and they are probably defined as
void * in the C interfaces).
In my own code, I have roughly 500 odd uses, including:
The use breaks down as:
* General arbitrary memory pointer (eg for BlockMove, FileWriteData, etc)
* Pointers to polymorphic type (eg CFPropertyListRef is a "subclass"
of CFTypeRef, and shares functions like Destroy, Show, etc).
* Pointers to extendable types (eg MyQElemPtr points to a record that
must start with a QElemRecord, but then continues with user data).
* Storage/Retrieval of user data (eg, user data is 32 bits, and can
store an arbitrary user data like a reference number or pointer).
* Low level data manipulation (like read/write 16/32/64 bit
quantities from a file).
So basically Pointer and sized integer are the uses I have, and the
sized integer that matches the size of pointer needs to be
compatible. Also, ideally, it would be compatible with function
pointer as well, since that would be one thing that might want to be
stored in a userdata field.
More information about the Gpc