/[ascend]/trunk/base/generic/utilities/ascMalloc.h
ViewVC logotype

Diff of /trunk/base/generic/utilities/ascMalloc.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 707 by johnpye, Wed Jun 21 07:00:45 2006 UTC revision 708 by johnpye, Tue Jun 27 07:34:31 2006 UTC
# Line 103  Line 103 
103  /**  /**
104      Shorthand for creating pointers to newly allocated data of a given type      Shorthand for creating pointers to newly allocated data of a given type
105  */  */
106  #define ASC_NEW(TYPE) (TYPE *)ascmalloc(sizeof(TYPE))  #define ASC_NEW(TYPE) (TYPE*)ascmalloc(sizeof(TYPE))
107    
108  #define ASC_NEW_CLEAR(TYPE) (TYPE *)asccalloc(1,sizeof(TYPE))  #define ASC_NEW_CLEAR(TYPE) (TYPE*)asccalloc(1,sizeof(TYPE))
109    
110  /**  /**
111      Shorthand for creating pointer to an array of newly allocated data of a      Shorthand for creating pointer to an array of newly allocated data of a
112      given type. 'ascmalloc' is used for the allocation.      given type. 'ascmalloc' is used for the allocation.
113  */  */
114  #define ASC_NEW_ARRAY(TYPE,COUNT) (TYPE *)ascmalloc(sizeof(TYPE)*(COUNT))  #define ASC_NEW_ARRAY(TYPE,COUNT) (TYPE*)ascmalloc(sizeof(TYPE)*(COUNT))
115    
116  /**  /**
117      Shorthand for creating a pointer to allocated data, using asccalloc (to zero      Shorthand for creating a pointer to allocated data, using asccalloc (to zero
118      the allocated space).      the allocated space).
119  */  */
120  #define ASC_NEW_ARRAY_CLEAR(TYPE,COUNT) (TYPE *)asccalloc(COUNT,sizeof(TYPE))  #define ASC_NEW_ARRAY_CLEAR(TYPE,COUNT) (TYPE*)asccalloc((COUNT),sizeof(TYPE))
121    
122  /**  /**
123      Shorthand for creating a pointer to an array of allocated data. If the      Shorthand for creating a pointer to an array of allocated data. If the

Legend:
Removed from v.707  
changed lines
  Added in v.708

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22