return 0;
#endif
}
-/* END OF PAGE ...
-
- ... START OF PAGE */
/*
* SECURE HEAP IMPLEMENTATION
OPENSSL_assert(size > 0);
OPENSSL_assert((size & (size - 1)) == 0);
OPENSSL_assert((minsize & (minsize - 1)) == 0);
- if (size <= 0 || (size & (size - 1)) != 0)
+ if (size == 0 || (size & (size - 1)) != 0)
goto err;
if (minsize == 0 || (minsize & (minsize - 1)) != 0)
goto err;
- while (minsize < (int)sizeof(SH_LIST))
+ while (minsize < sizeof(SH_LIST))
minsize *= 2;
sh.arena_size = size;
pgsize = PAGE_SIZE;
#endif
sh.map_size = pgsize + sh.arena_size + pgsize;
- if (1) {
+
#ifdef MAP_ANON
- sh.map_result = mmap(NULL, sh.map_size,
- PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
- } else {
-#endif
+ sh.map_result = mmap(NULL, sh.map_size,
+ PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
+#else
+ {
int fd;
sh.map_result = MAP_FAILED;
close(fd);
}
}
+#endif
if (sh.map_result == MAP_FAILED)
goto err;
sh.arena = (char *)(sh.map_result + pgsize);
# define CRYPTO_EX_INDEX_RAND_DRBG 15
# define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG
# define CRYPTO_EX_INDEX_OPENSSL_CTX 16
-# define CRYPTO_EX_INDEX_COUNT 17
-# define CRYPTO_EX_INDEX__COUNT CRYPTO_EX_INDEX_COUNT
+# define CRYPTO_EX_INDEX__COUNT 17
typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);