[阅读: 561] 2004-12-17 03:52:45
char* AllocateString( unsigned int nSize )
{
nSize;// just make compiler happy
return NULL;
}
...
void ReleaseAllocator()
{
//...
}
...
typedef char* ( *New )( unsigned int );
typedef void ( *Release )();
struct StringAllocator
{
New allocate;
Release release;
};
...
struct StringAllocator theAllocator;
theAllocator.allocate = AllocateString;
theAllocator.release = ReleaseAllocator;
atexit( theAllocator.release );