[Groonga-commit] groonga/grnxx at 25a93fe [master] Update exception messages from "Failed" to "Memory allocation failed".

Back to archive index

susumu.yata null+****@clear*****
Mon Dec 1 14:55:29 JST 2014


susumu.yata	2014-12-01 14:55:29 +0900 (Mon, 01 Dec 2014)

  New Revision: 25a93feab73a7102a8580ed77df78cc673f222e6
  https://github.com/groonga/grnxx/commit/25a93feab73a7102a8580ed77df78cc673f222e6

  Message:
    Update exception messages from "Failed" to "Memory allocation failed".

  Modified files:
    lib/grnxx/string.cpp

  Modified: lib/grnxx/string.cpp (+4 -4)
===================================================================
--- lib/grnxx/string.cpp    2014-12-01 14:08:11 +0900 (2268e7a)
+++ lib/grnxx/string.cpp    2014-12-01 14:55:29 +0900 (fc5e5a3)
@@ -44,7 +44,7 @@ String::String(size_t size, char byte)
   if (size != 0) {
     char *new_buffer = static_cast<char *>(std::malloc(size));
     if (!new_buffer) {
-      throw "Failed";  // TODO
+      throw "Memory allocation failed";  // TODO
     }
     std::memset(new_buffer, byte, size);
     buffer_ = new_buffer;
@@ -68,7 +68,7 @@ String &String::instantiate() {
   }
   char *new_buffer = static_cast<char *>(std::malloc(size_));
   if (!new_buffer) {
-    throw "Failed";  // TODO
+    throw "Memory allocation failed";  // TODO
   }
   std::memcpy(new_buffer, data_, size_);
   buffer_ = new_buffer;
@@ -83,7 +83,7 @@ void String::resize_buffer(size_t new_size) {
   }
   char *new_buffer = static_cast<char *>(std::malloc(new_capacity));
   if (!new_buffer) {
-    throw "Failed";  // TODO
+    throw "Memory allocation failed";  // TODO
   }
   std::memcpy(new_buffer, data_, size_);
   if (capacity_ != 0) {
@@ -101,7 +101,7 @@ void String::append_overlap(const char *data, size_t size) {
   }
   char *new_buffer = static_cast<char *>(std::malloc(new_capacity));
   if (!new_buffer) {
-    throw "Failed";  // TODO
+    throw "Memory allocation failed";  // TODO
   }
   std::memcpy(new_buffer, buffer_, size_);
   std::memcpy(new_buffer + size_, data, size);
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index