Mercurial > cpython-lru_cache-weakref
diff Include/code.h @ 37838:cc48985c3266 legacy-trunk
Refactor: Move code that uses co_lnotab from ceval to codeobject
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Tue, 18 Apr 2006 14:47:00 +0000 |
| parents | cea54c9d921d |
| children | a637c78bf119 |
line wrap: on
line diff
--- a/Include/code.h Tue Apr 18 14:04:57 2006 +0000 +++ b/Include/code.h Tue Apr 18 14:47:00 2006 +0000 @@ -72,6 +72,21 @@ ((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \ ((co)->co_code, 0, (void **)(pp))) +typedef struct _addr_pair { + int ap_lower; + int ap_upper; +} PyAddrPair; + +/* Check whether lasti (an instruction offset) falls outside bounds + and whether it is a line number that should be traced. Returns + a line number if it should be traced or -1 if the line should not. + + If lasti is not within bounds, updates bounds. +*/ + +PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, + int lasti, PyAddrPair *bounds); + #ifdef __cplusplus } #endif
