diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-03-06 17:18:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-03-06 17:18:40 +0100 |
commit | 28937f1196166ef33c303ff09f0d7f4936faec81 (patch) | |
tree | 81d6fae2161fe976ca587b7a58d10fda41f7e93b /libcpp/internal.h | |
parent | b681bb9507df9bf700eac671e3c999bd735b1939 (diff) | |
download | gcc-28937f1196166ef33c303ff09f0d7f4936faec81.zip gcc-28937f1196166ef33c303ff09f0d7f4936faec81.tar.gz gcc-28937f1196166ef33c303ff09f0d7f4936faec81.tar.bz2 |
re PR middle-end/56461 (GCC is leaking lots of memory)
PR middle-end/56461
* internal.h (struct cpp_buffer): Add to_free field.
(_cpp_pop_file_buffer): Add third argument.
* files.c (_cpp_stack_file): Set buffer->to_free.
(_cpp_pop_file_buffer): Add to_free argument. Free to_free
if non-NULL, and if equal to file->buffer_start, also clear
file->buffer{,_start,_valid}.
* directives.c (_cpp_pop_buffer): Pass buffer->to_free
to _cpp_pop_file_buffer.
From-SVN: r196497
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r-- | libcpp/internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h index 7731666..1226dbd 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -301,6 +301,8 @@ struct cpp_buffer const unsigned char *buf; /* Entire character buffer. */ const unsigned char *rlimit; /* Writable byte at end of file. */ + const unsigned char *to_free; /* Pointer that should be freed when + popping the buffer. */ _cpp_line_note *notes; /* Array of notes. */ unsigned int cur_note; /* Next note to process. */ @@ -635,7 +637,8 @@ extern int _cpp_compare_file_date (cpp_reader *, const char *, int); extern void _cpp_report_missing_guards (cpp_reader *); extern void _cpp_init_files (cpp_reader *); extern void _cpp_cleanup_files (cpp_reader *); -extern void _cpp_pop_file_buffer (cpp_reader *, struct _cpp_file *); +extern void _cpp_pop_file_buffer (cpp_reader *, struct _cpp_file *, + const unsigned char *); extern bool _cpp_save_file_entries (cpp_reader *pfile, FILE *f); extern bool _cpp_read_file_entries (cpp_reader *, FILE *); extern const char *_cpp_get_file_name (_cpp_file *); |