Robert Kern avatar 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.

Comments (0)

Files changed (1)

_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).
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.