Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Side by Side Diff: Python/pythonrun.c

Issue 13390: Hunt memory allocations in addition to reference leaks
Patch Set: Created 8 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 /* Python interpreter top-level routines, including init/exit */ 2 /* Python interpreter top-level routines, including init/exit */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 5
6 #include "Python-ast.h" 6 #include "Python-ast.h"
7 #undef Yield /* undefine macro conflicting with winbase.h */ 7 #undef Yield /* undefine macro conflicting with winbase.h */
8 #include "grammar.h" 8 #include "grammar.h"
9 #include "node.h" 9 #include "node.h"
10 #include "token.h" 10 #include "token.h"
(...skipping 20 matching lines...) Expand all
31 31
32 #ifdef MS_WINDOWS 32 #ifdef MS_WINDOWS
33 #undef BYTE 33 #undef BYTE
34 #include "windows.h" 34 #include "windows.h"
35 #define PATH_MAX MAXPATHLEN 35 #define PATH_MAX MAXPATHLEN
36 #endif 36 #endif
37 37
38 #ifndef Py_REF_DEBUG 38 #ifndef Py_REF_DEBUG
39 #define PRINT_TOTAL_REFS() 39 #define PRINT_TOTAL_REFS()
40 #else /* Py_REF_DEBUG */ 40 #else /* Py_REF_DEBUG */
41 #define PRINT_TOTAL_REFS() fprintf(stderr, \ 41 #define PRINT_TOTAL_REFS() fprintf(stderr, \
42 "[%" PY_FORMAT_SIZE_T "d refs]\n", \ 42 "[%" PY_FORMAT_SIZE_T "d refs, " \
43 _Py_GetRefTotal()) 43 "%" PY_FORMAT_SIZE_T "d blocks]\n", \
44 _Py_GetRefTotal(), _Py_AllocedBlocks)
44 #endif 45 #endif
45 46
46 #ifdef __cplusplus 47 #ifdef __cplusplus
47 extern "C" { 48 extern "C" {
48 #endif 49 #endif
49 50
50 extern wchar_t *Py_GetPath(void); 51 extern wchar_t *Py_GetPath(void);
51 52
52 extern grammar _PyParser_Grammar; /* From graminit.c */ 53 extern grammar _PyParser_Grammar; /* From graminit.c */
53 54
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 #undef PyRun_InteractiveLoop 2549 #undef PyRun_InteractiveLoop
2549 PyAPI_FUNC(int) 2550 PyAPI_FUNC(int)
2550 PyRun_InteractiveLoop(FILE *f, const char *p) 2551 PyRun_InteractiveLoop(FILE *f, const char *p)
2551 { 2552 {
2552 return PyRun_InteractiveLoopFlags(f, p, NULL); 2553 return PyRun_InteractiveLoopFlags(f, p, NULL);
2553 } 2554 }
2554 2555
2555 #ifdef __cplusplus 2556 #ifdef __cplusplus
2556 } 2557 }
2557 #endif 2558 #endif
OLDNEW
« Objects/obmalloc.c ('K') | « Objects/obmalloc.c ('k') | Python/sysmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+