change matrix dimensions from inside custom external

    Feb 14 2015 | 5:02 pm
    hi there i'm working on an external that does phase vocoder analysis of buffer based audio data and stores the results into a user specified jitter matrix. as i don't know the length of the audio data before hand, i need to be able to change the matrix dimensions before starting to write into it. i found a very easy way to do this, but i'm not sure whether it's safe! basically i'm filling out a t_jit_matrix_info with the dimensions i need and apply it to the matrix in question through _jit_sym_setinfo (see code below). obviously there's some memory (re)allocation going on under the hood - do i need to watch out for something? so far it seems to work just fine. thanks, volker.
    int myObj_checkDims(t_myObj *x, long dim0, long dim1, long pc) 
    	t_jit_matrix_info minfo;
    	void		*matrix;
    	long	savelock;
    	matrix = jit_object_findregistered(x->matrix_name);
    	if (matrix&&jit_object_method(matrix, _jit_sym_class_jit_matrix)) {
    		savelock = (long) jit_object_method(matrix,_jit_sym_lock,1);
    		// check if dimensions changed
    		if(minfo.dim[0]!=dim0 || minfo.dim[1]!=dim1 || minfo.planecount!=pc) {
    			minfo.dim[0] = dim0;
    			minfo.dim[1] = dim1;
    			minfo.planecount = pc;
    			// set correct matrix dims and planecount...
    		return 1;
    	} else {
    		return 0;