diff libinterp/corefcn/mexproto.h @ 22464:1d2960b5efe6

Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix. * NEWS: Announce new functions. * mexproto.h: Add prototypes for new functions. * mxarray.in.h: Add 5th input (bool init = true) to mxArray constructors that map to mxCreateNumericArray and mxCreateNumericMatrix. * mex.cc (mxCreateUninitNumericArray): New function. Calls constructor mxArray (class_id, ndims, dims, flag, false), i.e., with init = false. * mex.cc (mxCreateUninitNumericArray): New function. Calls constructor mxArray (class_id, m, n, flag, false), i.e., with init = false. * mex.cc (mxArray::mxArray): Change constructors to pass init flag to constructors for mxArray_number. * mex.cc (mxArray_number): Change constructors to use init flag to decide whether calloc (init = true) or malloc (init = false) is used to get memory for the elements in the array.
author Rik <rik@octave.org>
date Sun, 11 Sep 2016 07:58:42 -0700
parents 6cb7813e5b2f
children 6149f6b34cbc
line wrap: on
line diff
--- a/libinterp/corefcn/mexproto.h	Sat Sep 10 07:51:22 2016 -0700
+++ b/libinterp/corefcn/mexproto.h	Sun Sep 11 07:58:42 2016 -0700
@@ -160,6 +160,14 @@
 extern OCTINTERP_API mxArray *mxCreateNumericMatrix (mwSize m, mwSize n,
                                                      mxClassID class_id,
                                                      mxComplexity flag);
+extern OCTINTERP_API mxArray *mxCreateUninitNumericArray (mwSize ndims,
+                                                          const mwSize *dims,
+                                                          mxClassID class_id,
+                                                          mxComplexity flag);
+extern OCTINTERP_API mxArray *mxCreateUninitNumericMatrix (mwSize m, mwSize n,
+                                                           mxClassID class_id,
+                                                           mxComplexity flag);
+
 extern OCTINTERP_API mxArray *mxCreateSparse (mwSize m, mwSize n, mwSize nzmax,
                                               mxComplexity flag);
 extern OCTINTERP_API mxArray *mxCreateSparseLogicalMatrix (mwSize m, mwSize n,