User`s guide

External Interfaces/API
16-25
Do Not Use mxFree to Destroy mxArrays
It is improper to call mxFree on an mxArray. Previously, to remedy misleading
statements in older documentation, under limited circumstances, MATLAB issued a
warning in code that made this error. MATLAB no longer issues the warning.
Compatibility Considerations
The correct function to use to release memory for an mxArray is mxDestroyArray.
Calling mxFree on an mxArray could cause memory corruption, which might result in a
segmentation violation.
Cannot Build MEX-Files Using MATLAB Version 5 API
MATLAB does not support the -V5 option to the mex function.
Compatibility Considerations
You are no longer able to build a MEX-file using the MATLAB Version 5 API. If you use
any of the functions shown in the “Obsolete Functions: MX Array Manipulation” on page
22-31 table, you must replace them with functions from the Replacement column,
if available. These obsolete functions were deprecated when MATLAB Version 6 was
released over 5 years ago.
MEX-Files Calling BLAS or LAPACK Functions Must Be Updated On 64-Bit
Platforms
You must update any MEX-file that calls functions in the BLAS or LAPACK math
packages on 64-bit platforms. The change occurs as a result of updated support,
described in “64-bit Support in LAPACK and BLAS” on page 16-14. Existing MEX-files
generated in previous versions of MATLAB will result in undefined behavior (likely
crashes), if run in R2009a. The previous versions pass 32-bit integer arguments, but the
math routines now read and write to 64 bits of memory. The results you see depend on
what is stored in the subsequent 32 bits of memory.