* For details on that implementation, see below (look for uppercase
* "SECURE HEAP IMPLEMENTATION").
*/
-#include <openssl/crypto.h>
#include "e_os.h"
+#include <openssl/crypto.h>
#include <string.h>
int ret = 0;
if (!secure_mem_initialized) {
- sec_malloc_lock = CRYPTO_THREAD_lock_new();
+ sec_malloc_lock = CRYPTO_THREAD_glock_new("sec_malloc");
if (sec_malloc_lock == NULL)
return 0;
if ((ret = sh_init(size, minsize)) != 0) {
size_t pgsize;
size_t aligned;
- memset(&sh, 0, sizeof sh);
+ memset(&sh, 0, sizeof(sh));
/* make sure size and minsize are powers of 2 */
OPENSSL_assert(size > 0);
for (i = sh.bittable_size; i; i >>= 1)
sh.freelist_size++;
- sh.freelist = OPENSSL_zalloc(sh.freelist_size * sizeof (char *));
+ sh.freelist = OPENSSL_zalloc(sh.freelist_size * sizeof(char *));
OPENSSL_assert(sh.freelist != NULL);
if (sh.freelist == NULL)
goto err;
OPENSSL_free(sh.bitmalloc);
if (sh.map_result != NULL && sh.map_size)
munmap(sh.map_result, sh.map_size);
- memset(&sh, 0, sizeof sh);
+ memset(&sh, 0, sizeof(sh));
}
static int sh_allocated(const char *ptr)