-#pragma mark *** CF Allocators ***
-
-/* copied from CSSMCFUtilities in the AppleCSP:CSPLib project.... */
-
-static void* cfAllocate(CFIndex size, CFOptionFlags hint, void *info)
-{
- return sslMalloc((Size)size);
-}
-
-static void* cfReallocate(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info)
-{
- return sslRealloc(ptr, (Size)newsize, (Size)newsize);
-}
-
-static void cfDeallocate(void *ptr, void *info)
-{
- sslFree(ptr);
-}
-
-/*
- * Set up/tear down CF allocators.
- */
-OSStatus cfSetUpAllocators(SSLContext *ctx)
-{
- /* Initialize gCFAllocatorContext with the system default
- allocator context. */
- CFAllocatorGetContext(kCFAllocatorSystemDefault, &ctx->lCFAllocatorContext);
-
- ctx->lCFAllocatorContext.allocate = cfAllocate;
- ctx->lCFAllocatorContext.reallocate = cfReallocate;
- ctx->lCFAllocatorContext.deallocate = cfDeallocate;
-
- ctx->cfAllocatorRef = CFAllocatorCreate(kCFAllocatorUseContext,
- &ctx->lCFAllocatorContext);
- if (!ctx->cfAllocatorRef)
- return memFullErr;
-
- return noErr;
-}
-
-void cfTearDownAllocators(SSLContext *ctx)
-{
- if (ctx->cfAllocatorRef != NULL)
- CFRelease(ctx->cfAllocatorRef);
-}
-