octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31707] mxSetDimensions complains about mxFree


From: anonymous
Subject: [Octave-bug-tracker] [bug #31707] mxSetDimensions complains about mxFree
Date: Fri, 19 Nov 2010 12:00:32 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12

URL:
  <http://savannah.gnu.org/bugs/?31707>

                 Summary: mxSetDimensions complains about mxFree
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fr 19 Nov 2010 12:00:31 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Andreas Zoellner
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

The MEX function mxSetDimensions issues the following warning:


warning: mxFree: skipping memory not allocated by mxMalloc, mxCalloc, or
mxRealloc


Consider the following file "bug.cpp":

#include "mex.h"

#define X prhs[0]
#define Y plhs[0]

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
  if (nrhs < 1) mexErrMsgTxt("One input argument required.");
  
  Y = mxCreateDoubleMatrix(mxGetM(X), mxGetN(X), mxREAL);
  mxSetDimensions( Y, mxGetDimensions(X), mxGetNumberOfDimensions(X) );
}


and try

>> mex bug.cpp; x=rand(2,2,2); y=bug(x); x,y


----
Octave Version 3.2.4, official binary from Octave Forge
(http://sourceforge.net/projects/octave/files/Octave_Windows%20-%20MinGW/Octave%203.2.4%20for%20Windows%20MinGW32%20Installer/Octave-3.2.4_i686-pc-mingw32_gcc-4.4.0_setup.exe)





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31707>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]