mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:34:13 +08:00
mdbx-windows: fix mdbx_realloc()
for nullptr and MDBX_AVOID_CRT=ON
.
Change-Id: I129221186d65254da5b1d84747e5c59d53864b70
This commit is contained in:
parent
e6eeb17030
commit
3e7459b428
@ -21,6 +21,7 @@ Added features:
|
|||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
- Fixed missing cleanup (null assigned) in the C++ commit/abort (https://github.com/erthink/libmdbx/pull/143).
|
- Fixed missing cleanup (null assigned) in the C++ commit/abort (https://github.com/erthink/libmdbx/pull/143).
|
||||||
|
- Fixed `mdbx_realloc()` for case of nullptr and `MDBX_AVOID_CRT=ON` for Windows.
|
||||||
|
|
||||||
|
|
||||||
## v0.9.2 scheduled at 2020-11-27
|
## v0.9.2 scheduled at 2020-11-27
|
||||||
|
@ -181,7 +181,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
|
|||||||
|
|
||||||
#ifndef mdbx_realloc
|
#ifndef mdbx_realloc
|
||||||
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
|
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
|
||||||
return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
|
return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
|
||||||
|
: LocalAlloc(LMEM_FIXED, bytes);
|
||||||
}
|
}
|
||||||
#endif /* mdbx_realloc */
|
#endif /* mdbx_realloc */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user