C and Fortran API Reference - The MathWorks - #101

/ 263


catalogue search
P. 101
P. 102
P. 103
P. 104
P. 105
P. 106
P. 107
P. 108
P. 109
P. 110
P. 111
P. 112
P. 113
P. 114
P. 115
P. 116
P. 117
P. 118
P. 119
P. 120
P. 121
P. 122
P. 123
P. 124
P. 125
P. 126
P. 127
P. 128
P. 129
P. 130
P. 131
P. 132
P. 133
P. 134
P. 135
P. 136
P. 137
P. 138
P. 139
P. 140
P. 141
P. 142
P. 143
P. 144
P. 145
P. 146
P. 147
P. 148
P. 149
P. 150


See other catalogues for The MathWorks

Text version of the page
mxCalloc (C and Fortran)
The memory manager maintains a list of all memory allocated by mxCalloc. The memory manager automatically frees (deallocates) all MEX-file parcels when control returns to the MATLAB prompt.
InstandaloneMATLABCapplications,mxCalloc calls the ANSI® C
calloc function.
By default, in a MEX-file, mxCalloc generates nonpersistent mxCalloc data. In other words, the memory manager automatically deallocates the memory as soon as the MEX-file ends. If you want the memory to persist after the MEX-file completes, call mexMakeMemoryPersistent after calling mxCalloc. If you write a MEX-file with persistent memory, be sure to register a mexAtExit function to free allocated memory in the event your MEX-file is cleared.
When you finish using the memory allocated by mxCalloc,callmxFree to deallocate the memory.
C See
Examples
• explore, c in the mex subdirectory of the examples directory
• phonebook.c and revord.c in the refbook subdirectory of the examples directory
For additional examples, see mxcalcsinglesubscript.c and mxsetdimensions.c in the mx subdirectory of the examples directory.
See Also mexAtExit, mexMakeArrayPersistent, mexMakeMemoryPersistent,
mxDestroyArray, mxFree, mxMalloc, mxRealloc
2-83

pageCatalog pdf di En 2012-06-22-01