diff options
author | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-11-03 23:54:01 +0000 |
---|---|---|
committer | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-11-03 23:54:01 +0000 |
commit | bbd8e82a7fa12d8c56882ec6a9d6d42bebd7983c (patch) | |
tree | 877efd725b0ee7c3027a0879a4807647826ca1fb /src/processor/map_serializers.h | |
parent | Fix broken build of mac crash report tool. (diff) | |
download | breakpad-bbd8e82a7fa12d8c56882ec6a9d6d42bebd7983c.tar.xz |
Make memory allocation/deallocation consistent: use new char[] instead of operator new()
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@724 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/map_serializers.h')
-rw-r--r-- | src/processor/map_serializers.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/processor/map_serializers.h b/src/processor/map_serializers.h index 9c68e3f7..a0b9d3fd 100644 --- a/src/processor/map_serializers.h +++ b/src/processor/map_serializers.h @@ -65,6 +65,7 @@ class StdMapSerializer { // described in "StaticMap.h" comment. // Returns a pointer to the serialized data. If size != NULL, *size is set // to the size of serialized data, i.e., SizeOf(m). + // Caller has the ownership of memory allocated as "new char[]". char* Serialize(const std::map<Key, Value> &m, unsigned int *size) const; private: @@ -92,6 +93,7 @@ class AddressMapSerializer { // Serializes an AddressMap object into a chunk of memory data. // Returns a pointer to the serialized data. If size != NULL, *size is set // to the size of serialized data, i.e., SizeOf(m). + // Caller has the ownership of memory allocated as "new char[]". char* Serialize(const AddressMap<Addr, Entry> &m, unsigned int *size) const { return std_map_serializer_.Serialize(m.map_, size); } @@ -118,6 +120,7 @@ class RangeMapSerializer { // Serializes a RangeMap object into a chunk of memory data. // Returns a pointer to the serialized data. If size != NULL, *size is set // to the size of serialized data, i.e., SizeOf(m). + // Caller has the ownership of memory allocated as "new char[]". char* Serialize(const RangeMap<Address, Entry> &m, unsigned int *size) const; private: @@ -147,6 +150,7 @@ class ContainedRangeMapSerializer { // Serializes a ContainedRangeMap object into a chunk of memory data. // Returns a pointer to the serialized data. If size != NULL, *size is set // to the size of serialized data, i.e., SizeOf(m). + // Caller has the ownership of memory allocated as "new char[]". char* Serialize(const ContainedRangeMap<AddrType, EntryType> *m, unsigned int *size) const; |