Robert Kern  committed a68bd58

BUG: Go back to using PY_LONG_LONG as the accumulator. Windows uses such a small timer unit that overflow of a plain long actually occurs. This may reduce compatibility with Python 2.4; still testing that.

  • Participants
  • Parent commits 073319f
  • Branches default

Comments (0)

Files changed (1)

File _line_profiler.pyx

     cdef public object code
     cdef public int lineno
-    cdef public long total_time
-    cdef public long nhits
+    # Note: leave at least total_time private. This should help compile under
+    # Python 2.4.
+    cdef PY_LONG_LONG total_time
+    cdef long nhits
     def __init__(self, object code, int lineno):
         self.code = code
         """ Record a line timing.
         self.nhits += 1
-        self.total_time += <long>dt
+        self.total_time += dt
     def astuple(self):
         """ Convert to a tuple of (lineno, nhits, total_time).