diff options
author | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-11-01 17:31:31 +0000 |
---|---|---|
committer | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-11-01 17:31:31 +0000 |
commit | a8c1c466a16ad4c85bfd1ca20ab8fc056d669abe (patch) | |
tree | a2125b96e08b34b828364885d9cd52845a1eff93 /src/google_breakpad/processor/symbol_supplier.h | |
parent | Add missing module_serializer.h and module_serializer.cc for class ModuleSeri... (diff) | |
download | breakpad-a8c1c466a16ad4c85bfd1ca20ab8fc056d669abe.tar.xz |
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
Diffstat (limited to 'src/google_breakpad/processor/symbol_supplier.h')
-rw-r--r-- | src/google_breakpad/processor/symbol_supplier.h | 15 |
1 files changed, 11 insertions, 4 deletions
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 |