From a8c1c466a16ad4c85bfd1ca20ab8fc056d669abe Mon Sep 17 00:00:00 2001 From: "SiyangXie@gmail.com" Date: Mon, 1 Nov 2010 17:31:31 +0000 Subject: Restrict ownership of symbol data buffers to symbol supplier. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@721 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/google_breakpad/processor/symbol_supplier.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/google_breakpad/processor/symbol_supplier.h') diff --git a/src/google_breakpad/processor/symbol_supplier.h b/src/google_breakpad/processor/symbol_supplier.h index 4a41688e..26f5d7fa 100644 --- a/src/google_breakpad/processor/symbol_supplier.h +++ b/src/google_breakpad/processor/symbol_supplier.h @@ -76,14 +76,21 @@ class SymbolSupplier { string *symbol_file, string *symbol_data) = 0; - // Same as above, except places symbol data into symbol_data as C-string in - // dynamically allocated memory. Using C-string as type of symbol data enables - // passing data by pointer, and thus avoids unncessary copying of data (to - // improve memory efficiency). + // Same as above, except allocates data buffer on heap and then places the + // symbol data into the buffer as C-string. + // SymbolSupplier is responsible for deleting the data buffer. After the call + // to GetCStringSymbolData(), the caller should call FreeSymbolData(const + // Module *module) once the data buffer is no longer needed. + // If symbol_data is not NULL, symbol supplier won't return FOUND unless it + // returns a valid buffer in symbol_data, e.g., returns INTERRUPT on memory + // allocation failure. virtual SymbolResult GetCStringSymbolData(const CodeModule *module, const SystemInfo *system_info, string *symbol_file, char **symbol_data) = 0; + + // Frees the data buffer allocated for the module in GetCStringSymbolData. + virtual void FreeSymbolData(const CodeModule *module) = 0; }; } // namespace google_breakpad -- cgit v1.2.1