mdbx: add mdbx_malloc/mdbx_free, etc.

1 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43

Change-Id: Ia5204be9f943fefde42e6a46e652c1be6ab6a96b
This commit is contained in:
Leonid Yuriev
2018-10-12 22:01:36 +03:00
parent 777d1db5c9
commit ace3d1bfa3
9 changed files with 97 additions and 89 deletions

View File

@@ -221,7 +221,7 @@ int mdbx_vasprintf(char **strp, const char *fmt, va_list ap) {
return needed;
}
*strp = malloc(needed + 1);
*strp = mdbx_malloc(needed + 1);
if (unlikely(*strp == nullptr)) {
va_end(ones);
#if defined(_WIN32) || defined(_WIN64)
@@ -242,7 +242,7 @@ int mdbx_vasprintf(char **strp, const char *fmt, va_list ap) {
assert(actual == needed);
if (unlikely(actual < 0)) {
free(*strp);
mdbx_free(*strp);
*strp = nullptr;
}
return actual;
@@ -281,7 +281,7 @@ void mdbx_memalign_free(void *ptr) {
#if _MSC_VER
_aligned_free(ptr);
#else
free(ptr);
mdbx_free(ptr);
#endif
}
#endif /* mdbx_memalign_free */