Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Source/WRay_Memory.c
/* |
* WRay_Memory.c |
* |
* QuickDraw 3D 1.6 Sample |
* Robert Dierkes |
* |
* 07/28/98 RDD Created. |
*/ |
/*------------------*/ |
/* Include Files */ |
/*------------------*/ |
#include <Memory.h> |
#include "QD3D.h" |
#include "WRay_Error.h" |
#include "WRay_Memory.h" |
/*------------------*/ |
/* Constants */ |
/*------------------*/ |
/*----------------------*/ |
/* Global Declarations */ |
/*----------------------*/ |
/* |
* Memory_Sys_New |
*/ |
unsigned char *Memory_Sys_New( |
unsigned long size) |
{ |
return (unsigned char *) NewPtrSysClear(size); |
} |
/* |
* Memory_App_New |
*/ |
unsigned char *Memory_App_New( |
unsigned long size) |
{ |
return (unsigned char *) NewPtrClear(size); |
} |
/* |
* Memory_Dispose |
*/ |
void Memory_Dispose( |
void *memory) |
{ |
DisposePtr((Ptr) memory); |
} |
/* |
* Memory_Copy |
*/ |
void Memory_Copy( |
void *source, |
void *destination, |
unsigned long size) |
{ |
BlockMove(source, destination,(Size) size); |
} |
/* |
* Object_Dispose_NULL |
*/ |
TQ3Status Object_Dispose_NULL( |
TQ3Object *pObject) |
{ |
DEBUG_ASSERT(pObject != NULL, Object_Dispose_NULL); |
if (pObject == NULL) { |
return kQ3Failure; |
} |
if (*pObject != NULL) { |
Q3Object_Dispose(*pObject); |
*pObject = NULL; |
} |
return kQ3Success; |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14