"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Basic/Core/Core.xs" between
PDL-2.077.tar.gz and PDL-2.078.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Core.xs  (PDL-2.077):Core.xs  (PDL-2.078)
skipping to change at line 619 skipping to change at line 619
RETVAL = sv_bless(RETVAL, bless_stash); /* bless appropriately */ RETVAL = sv_bless(RETVAL, bless_stash); /* bless appropriately */
OUTPUT: OUTPUT:
RETVAL RETVAL
SV * SV *
get_dataref(self) get_dataref(self)
pdl *self pdl *self
CODE: CODE:
if(self->state & PDL_DONTTOUCHDATA) if(self->state & PDL_DONTTOUCHDATA)
croak("Trying to get dataref to magical (mmaped?) pdl"); croak("Trying to get dataref to magical (mmaped?) pdl");
PDLDEBUG_f(printf("get_dataref %p\n", self));
pdl_barf_if_error(pdl_make_physical(self)); /* XXX IS THIS MEMLEAK WITHOU T MORTAL? */ pdl_barf_if_error(pdl_make_physical(self)); /* XXX IS THIS MEMLEAK WITHOU T MORTAL? */
if (!self->datasv) { if (!self->datasv) {
PDLDEBUG_f(printf("get_dataref no datasv\n"));
self->datasv = newSVpvn("", 0); self->datasv = newSVpvn("", 0);
(void)SvGROW((SV *)self->datasv, self->nbytes); (void)SvGROW((SV *)self->datasv, self->nbytes);
SvCUR_set((SV *)self->datasv, self->nbytes);
memmove(SvPV_nolen((SV*)self->datasv), self->data, self->nbytes);
} }
RETVAL = newRV(self->datasv); RETVAL = newRV(self->datasv);
PDLDEBUG_f(printf("get_dataref end: "); pdl_dump(self));
OUTPUT: OUTPUT:
RETVAL RETVAL
void void
upd_data(self) upd_data(self, keep_datasv=0)
pdl *self pdl *self
IV keep_datasv
CODE: CODE:
if(self->state & PDL_DONTTOUCHDATA) if(self->state & PDL_DONTTOUCHDATA)
croak("Trying to touch dataref of magical (mmaped?) pdl"); croak("Trying to touch dataref of magical (mmaped?) pdl");
self->data = SvPV_nolen((SV*)self->datasv); PDLDEBUG_f(printf("upd_data: "); pdl_dump(self));
if (keep_datasv || !PDL_USESTRUCTVALUE(self)) {
self->data = SvPV_nolen((SV*)self->datasv);
} else if (self->datasv) {
PDLDEBUG_f(printf("upd_data zap datasv\n"));
memmove(self->data, SvPV_nolen((SV*)self->datasv), self->nbytes);
SvREFCNT_dec(self->datasv);
self->datasv = NULL;
} else {
PDLDEBUG_f(printf("upd_data datasv gone, maybe reshaped\n"));
}
PDLDEBUG_f(printf("upd_data end: "); pdl_dump(self));
void void
set_dataflow_f(self,value) set_dataflow_f(self,value)
pdl *self; pdl *self;
int value; int value;
CODE: CODE:
if(value) if(value)
self->state |= PDL_DATAFLOW_F; self->state |= PDL_DATAFLOW_F;
else else
self->state &= ~PDL_DATAFLOW_F; self->state &= ~PDL_DATAFLOW_F;
skipping to change at line 889 skipping to change at line 906
pdl_barf_if_error(pdl_make_physical(pdls[i])); /* is this what we want? XXX */ pdl_barf_if_error(pdl_make_physical(pdls[i])); /* is this what we want? XXX */
dtype = PDLMAX(dtype,pdls[i]->datatype); dtype = PDLMAX(dtype,pdls[i]->datatype);
} }
} }
for (i=npdls+1; i<=targs; i++) for (i=npdls+1; i<=targs; i++)
others[i-npdls-1] = ST(i); others[i-npdls-1] = ST(i);
if (nd2 < nc) if (nd2 < nc)
croak("Not enough dimension info to create pdls"); croak("Not enough dimension info to create pdls");
PDLDEBUG_f(for (i=0;i<npdls;i++) { printf("pdl %d ",i); pdl_dump(pdls[i]); } ); PDLDEBUG_f(for (i=0;i<npdls;i++) { printf("pdl %d ",i); pdl_dump(pdls[i]); } );
PDL_CLRMAGIC(&pdl_brc); PDL_CLRMAGIC(&pdl_brc);
pdl_brc.gflags = 0; /* avoid uninitialised value use below */
pdl_barf_if_error(pdl_initbroadcaststruct(0,pdls,realdims,creating,npdls, pdl_barf_if_error(pdl_initbroadcaststruct(0,pdls,realdims,creating,npdls,
NULL,&pdl_brc,NULL,NULL,NULL, 1)); NULL,&pdl_brc,NULL,NULL,NULL, 1));
for(i=0, nc=npdls; i<npdls; i++) /* create as necessary */ for(i=0, nc=npdls; i<npdls; i++) /* create as necessary */
if (creating[i]) { if (creating[i]) {
PDL_Indx *cp = creating+nc; PDL_Indx *cp = creating+nc;
pdls[i]->datatype = dtype; pdls[i]->datatype = dtype;
pdl_barf_if_error(pdl_broadcast_create_parameter(&pdl_brc,i,cp,0)); pdl_barf_if_error(pdl_broadcast_create_parameter(&pdl_brc,i,cp,0));
nc += realdims[i]; nc += realdims[i];
pdl_barf_if_error(pdl_make_physical(pdls[i])); pdl_barf_if_error(pdl_make_physical(pdls[i]));
PDLDEBUG_f(pdl_dump(pdls[i])); PDLDEBUG_f(pdl_dump(pdls[i]));
 End of changes. 8 change blocks. 
2 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)