0 Star 0 Fork 18

wangjie/IvorySQL

forked from IvorySQL/IvorySQL 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
explicit_bzero.c 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
Bruce Momjian 提交于 2024-01-04 09:49 +08:00 . Update copyright for 2024
/*-------------------------------------------------------------------------
*
* explicit_bzero.c
*
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/port/explicit_bzero.c
*
*-------------------------------------------------------------------------
*/
#include "c.h"
#if defined(HAVE_MEMSET_S)
void
explicit_bzero(void *buf, size_t len)
{
(void) memset_s(buf, len, 0, len);
}
#elif defined(WIN32)
void
explicit_bzero(void *buf, size_t len)
{
(void) SecureZeroMemory(buf, len);
}
#else
/*
* Indirect call through a volatile pointer to hopefully avoid dead-store
* optimisation eliminating the call. (Idea taken from OpenSSH.) We can't
* assume bzero() is present either, so for simplicity we define our own.
*/
static void
bzero2(void *buf, size_t len)
{
memset(buf, 0, len);
}
static void (*volatile bzero_p) (void *, size_t) = bzero2;
void
explicit_bzero(void *buf, size_t len)
{
bzero_p(buf, len);
}
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/Jugier/IvorySQL.git
git@gitee.com:Jugier/IvorySQL.git
Jugier
IvorySQL
IvorySQL
master

搜索帮助