Changeset 20255


Ignore:
Timestamp:
02/27/16 19:07:19 (9 years ago)
Author:
Eric.Larour
Message:

CHG: added a check that makes sure the memory increment is sufficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/io/fileptr.js

    r19814 r20255  
    3333                        this.buffersize=0;
    3434                        if (this.mode=='w'){
    35                                 this.increment=options.getfieldvalue('increment',80000); //80000 bytes,  10000 doubles.
     35                                this.increment=options.getfieldvalue('increment',800000); //80000 bytes,  10000 doubles.
    3636                                this.buffer=new ArrayBuffer(this.increment);
    3737                                this.view=new DataView(this.buffer);
     
    7272                                else{
    7373                                        if (!IsArray(value[0])){
    74                                                 if(this.ptr+value.length*8>=this.buffer.byteLength)this.resize();
     74                                                if(this.ptr+value.length*8>=this.buffer.byteLength){
     75                                                        this.resize();
     76                                                        if(this.ptr+value.length*8>=this.buffer.byteLength)throw Error('fileptr.fwrite error: need to increase increment size!');
     77                                                }
    7578                                                for(var i=0;i<value.length;i++){
    7679                                                        this.view.setFloat64(this.ptr,value[i],true);
Note: See TracChangeset for help on using the changeset viewer.