提交 b805f2be 编写于 作者: E Enrico Giordani

Calling abort() in redisOutOfMemoryHandler().

Changed out-of-memory error report.
上级 18a65331
......@@ -483,8 +483,12 @@ void _redisAssertWithInfo(redisClient *c, robj *o, char *estr, char *file, int l
void _redisPanic(char *msg, char *file, int line) {
bugReportStart();
redisLog(REDIS_WARNING,"------------------------------------------------");
#ifdef _WIN32
redisLog(REDIS_WARNING, "Fatal Error: %s #%s:%d", msg, file, line);
#else
redisLog(REDIS_WARNING,"!!! Software Failure. Press left mouse button to continue");
redisLog(REDIS_WARNING,"Guru Meditation: %s #%s:%d",msg,file,line);
#endif
#ifdef HAVE_BACKTRACE
redisLog(REDIS_WARNING,"(forcing SIGSEGV in order to print the stack trace)");
#endif
......
......@@ -3389,9 +3389,17 @@ void loadDataFromDisk(void) {
}
void redisOutOfMemoryHandler(size_t allocation_size) {
redisLog(REDIS_WARNING,"Out Of Memory allocating %Iu bytes!", WIN_PORT_FIX /* %zu -> %Iu */
#ifdef _WIN32
bugReportStart();
redisLog(REDIS_WARNING, "Out Of Memory allocating %Iu bytes.", /* %zu -> %Iu */
allocation_size);
// Call abort() instead of forcing an access violation in redisPanic
abort();
#else
redisLog(REDIS_WARNING,"Out Of Memory allocating %zu bytes!",
allocation_size);
redisPanic("Redis aborting for OUT OF MEMORY");
#endif
}
void redisSetProcTitle(char *title) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册