Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
redis
提交
f6a21370
R
redis
项目概览
别团等shy哥发育
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6a21370
编写于
6月 01, 2015
作者:
A
Alexis Campailla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Portability fixes
Add WIN_PORT_FIX macro Fixed debug oom command
上级
642df0ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
6 deletion
+16
-6
src/Win32_Interop/Win32_dlmalloc.c
src/Win32_Interop/Win32_dlmalloc.c
+0
-3
src/Win32_Interop/win32_types.h
src/Win32_Interop/win32_types.h
+5
-0
src/Win32_Interop/win32_util.h
src/Win32_Interop/win32_util.h
+8
-2
src/debug.c
src/debug.c
+3
-1
未找到文件。
src/Win32_Interop/Win32_dlmalloc.c
浏览文件 @
f6a21370
...
...
@@ -610,9 +610,6 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
#include <sys/types.h>
/* For size_t */
#endif
/* LACKS_SYS_TYPES_H */
/* The maximum possible size_t value has all bits set */
#define MAX_SIZE_T (~(size_t)0)
#define USE_LOCKS 1
#ifndef USE_LOCKS
/* ensure true if spin or recursive locks set */
...
...
src/Win32_Interop/win32_types.h
浏览文件 @
f6a21370
...
...
@@ -38,3 +38,8 @@ typedef long _off_t;
#define _OFF_T_DEFINED
#endif
/* The maximum possible size_t value has all bits set */
#define MAX_SIZE_T (~(size_t)0)
src/Win32_Interop/win32_util.h
浏览文件 @
f6a21370
...
...
@@ -28,7 +28,7 @@ extern "C"
#endif
/* Sometimes in the Windows port we make changes from:
/*
Sometimes in the Windows port we make changes from:
antirez_redis_statement();
to:
#ifdef _WIN32
...
...
@@ -52,9 +52,15 @@ extern "C"
Don't use any parenthesis or semi-colon after INDUCE_MERGE_CONFLICT.
Use it at the end of a line to preserve the original indentation.
*/
#define INDUCE_MERGE_CONFLICT
/* Use WIN_PORT_FIX at the end of a line to mark places where we make changes to the code
without using #ifdefs. Useful to keep the code more legible. Mainly intended for replacing
the use of long (which is 64-bit on 64-bit Unix and 32-bit on 64-bit Windows) to portable types.
In order to be eligible for an inline fix (without #ifdef), the change should be portable back to the Posix version.
*/
#define WIN_PORT_FIX
#ifdef _WIN32
#define IF_WIN32(x, y) x
#define WIN32_ONLY(x) x
...
...
src/debug.c
浏览文件 @
f6a21370
...
...
@@ -33,6 +33,8 @@
#ifndef _WIN32
#include <arpa/inet.h>
#else
#include "win32_interop/win32_util.h"
#endif
#include <signal.h>
...
...
@@ -258,7 +260,7 @@ void debugCommand(redisClient *c) {
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"segfault"
))
{
*
((
char
*
)
-
1
)
=
'x'
;
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"oom"
))
{
void
*
ptr
=
zmalloc
(
ULONG_MAX
);
/* Should trigger an out of memory. */
void
*
ptr
=
zmalloc
(
MAX_SIZE_T
);
/* Should trigger an out of memory. */
WIN_PORT_FIX
zfree
(
ptr
);
addReply
(
c
,
shared
.
ok
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"assert"
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录