Merge pull request #823 from mmichal10/fix-ram-check

Revert "Unstubify RAM check in posix evn"
This commit is contained in:
Robert Baldyga
2024-09-12 12:41:30 +02:00
committed by GitHub

11
env/posix/ocf_env.h vendored
View File

@@ -195,18 +195,9 @@ static inline void env_secure_free(const void *ptr, size_t size)
}
}
#include <sys/sysinfo.h>
static inline uint64_t env_get_free_memory(void)
{
struct sysinfo info;
int ret;
ret = sysinfo(&info);
if (ret != 0)
return 0;
return (uint64_t)info.totalram * info.mem_unit;
return (uint64_t)(-1);
}
/* ALLOCATOR */