1 /*-------------------------------------------------------------------------
5 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
6 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/port/explicit_bzero.c
12 *-------------------------------------------------------------------------
17 #if defined(HAVE_MEMSET_S)
20 explicit_bzero(void *buf
, size_t len
)
22 (void) memset_s(buf
, len
, 0, len
);
28 explicit_bzero(void *buf
, size_t len
)
30 (void) SecureZeroMemory(buf
, len
);
36 * Indirect call through a volatile pointer to hopefully avoid dead-store
37 * optimisation eliminating the call. (Idea taken from OpenSSH.) We can't
38 * assume bzero() is present either, so for simplicity we define our own.
42 bzero2(void *buf
, size_t len
)
47 static void (*volatile bzero_p
) (void *, size_t) = bzero2
;
50 explicit_bzero(void *buf
, size_t len
)