aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/minidump_file_writer.cc16
-rw-r--r--src/client/minidump_file_writer.h12
2 files changed, 18 insertions, 10 deletions
diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc
index d5e381b9..852bc297 100644
--- a/src/client/minidump_file_writer.cc
+++ b/src/client/minidump_file_writer.cc
@@ -216,6 +216,8 @@ MDRVA MinidumpFileWriter::Allocate(size_t size) {
}
bool MinidumpFileWriter::Copy(MDRVA position, const void* src, ssize_t size) {
+ assert(src);
+ assert(size);
assert(file_ != -1);
// Ensure that the data will fit in the allocated space
@@ -230,4 +232,18 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void* src, ssize_t size) {
return false;
}
+bool UntypedMDRVA::Allocate(size_t size) {
+ assert(size_ == 0);
+ size_ = size;
+ position_ = writer_->Allocate(size_);
+ return position_ != MinidumpFileWriter::kInvalidMDRVA;
+}
+
+bool UntypedMDRVA::Copy(MDRVA position, const void *src, size_t size) {
+ assert(src);
+ assert(size);
+ assert(position + size <= position_ + size_);
+ return writer_->Copy(position, src, size);
+}
+
} // namespace google_airbag
diff --git a/src/client/minidump_file_writer.h b/src/client/minidump_file_writer.h
index 24249a18..9f270b1e 100644
--- a/src/client/minidump_file_writer.h
+++ b/src/client/minidump_file_writer.h
@@ -109,12 +109,7 @@ class UntypedMDRVA {
// Allocates |size| bytes. Must not call more than once.
// Return true on success, or false on failure
- bool Allocate(size_t size) {
- assert(size_ == 0);
- size_ = size;
- position_ = writer_->Allocate(size_);
- return position_ != MinidumpFileWriter::kInvalidMDRVA;
- }
+ bool Allocate(size_t size);
// Returns the current position or kInvalidMDRVA if allocation failed
MDRVA position() const { return position_; }
@@ -130,10 +125,7 @@ class UntypedMDRVA {
// Copy |size| bytes starting at |src| into the minidump at |position|
// Return true on success, or false on failure
- bool Copy(MDRVA position, const void *src, size_t size) {
- assert(position + size <= position_ + size_);
- return writer_->Copy(position, src, size);
- }
+ bool Copy(MDRVA position, const void *src, size_t size);
// Copy |size| bytes from |src| to the current position
bool Copy(const void *src, size_t size) {