src/share/native/sun/security/ec/impl/ecc_impl.h
Print this page
@@ -41,10 +41,11 @@
#ifdef __cplusplus
extern "C" {
#endif
+#include <string.h>
#include <sys/types.h>
#include "ecl-exp.h"
/*
* Multi-platform definitions
@@ -99,16 +100,26 @@
#define PORT_ArenaAlloc(a, n, f) kmem_alloc((n), (f))
#define PORT_ArenaZAlloc(a, n, f) kmem_zalloc((n), (f))
#define PORT_ArenaGrow(a, b, c, d) NULL
#define PORT_ZAlloc(n, f) kmem_zalloc((n), (f))
#define PORT_Alloc(n, f) kmem_alloc((n), (f))
+#define PORT_ZFree(p, l) \
+ do { \
+ memset((p), 0, (l)); \
+ kmem_free((p), (l)); \
+ } while (0)
#else
#define PORT_ArenaAlloc(a, n, f) malloc((n))
#define PORT_ArenaZAlloc(a, n, f) calloc(1, (n))
#define PORT_ArenaGrow(a, b, c, d) NULL
#define PORT_ZAlloc(n, f) calloc(1, (n))
#define PORT_Alloc(n, f) malloc((n))
+#define PORT_ZFree(p, l) \
+ do { \
+ memset((p), 0, (l)); \
+ free((p)); \
+ } while (0)
#endif
#define PORT_NewArena(b) (char *)12345
#define PORT_ArenaMark(a) NULL
#define PORT_ArenaUnmark(a, b)