RAPL

Check-in [a36c72ccf5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:make the debugging info dependent of a flag variable
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a36c72ccf5188b9a180eb9f19eaa460254f52d69
User & Date: arnulf 2012-03-10 15:56:29
Context
2012-03-16
20:25
removed duplicate or unused code check-in: 3b95b2396a user: arnulf tags: trunk
2012-03-10
15:56
make the debugging info dependent of a flag variable check-in: a36c72ccf5 user: arnulf tags: trunk
2012-03-04
21:22
added param to incrRefCoutn decrRefCount and newObj for being able to check garbage collection and refcounting for rapl check-in: cc0ac3e341 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rapl_obj.js.

25
26
27
28
29
30
31

32
33
34
35
36
37
38
...
797
798
799
800
801
802
803

804
805

806
807
808
809
810
811
812
813
814

815
816

817
818
819
820
821
822
823
//print("RAPL_OBJECT!"+obj.oid+"!");
  obj.interp = interp;
  obj.ref_count = null,
  obj.bytes = null;
  obj.len = -1;
  obj.obj_type = null;
  obj.namespace = null;

  obj.internalRep = {
    /* the next code is tricky!
     * as we do not have unions in Javascript, we use the javascript object technique for
     * simulating that:
     * we have up to 3 value fields for use: value1, value2, value3
     * we use these for the various union parts
     * example:
................................................................................
  },

  /* ==================== incrRefCount ================================== */
  incrRefCount: function(where) {
    var obj = this;

    obj.ref_count++;

    if (typeof where != "undefined") {
      obj.incr_lst.push(where);

    }
    return obj.ref_count;
  },

  /* ==================== decrRefCount ================================== */
  decrRefCount: function(where) {
    var obj = this;

    obj.ref_count--;

    if (typeof where != "undefined") {
      obj.decr_lst.push(where);

    }
    if (obj.ref_count <= 0) {
      obj.freeObj(where);
    }
  },

  /* ==================== toDebugString ===================================== */







>







 







>
|
|
>









>
|
|
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
//print("RAPL_OBJECT!"+obj.oid+"!");
  obj.interp = interp;
  obj.ref_count = null,
  obj.bytes = null;
  obj.len = -1;
  obj.obj_type = null;
  obj.namespace = null;
  obj.check_allocate = false;
  obj.internalRep = {
    /* the next code is tricky!
     * as we do not have unions in Javascript, we use the javascript object technique for
     * simulating that:
     * we have up to 3 value fields for use: value1, value2, value3
     * we use these for the various union parts
     * example:
................................................................................
  },

  /* ==================== incrRefCount ================================== */
  incrRefCount: function(where) {
    var obj = this;

    obj.ref_count++;
    if (obj.check_allocate) {
      if (typeof where != "undefined") {
        obj.incr_lst.push(where);
      }
    }
    return obj.ref_count;
  },

  /* ==================== decrRefCount ================================== */
  decrRefCount: function(where) {
    var obj = this;

    obj.ref_count--;
    if (obj.check_allocate) {
      if (typeof where != "undefined") {
        obj.decr_lst.push(where);
      }
    }
    if (obj.ref_count <= 0) {
      obj.freeObj(where);
    }
  },

  /* ==================== toDebugString ===================================== */