Unstubify RAM check in posix evn
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
ebbf832cdc
commit
77d949bdcc
11
env/posix/ocf_env.h
vendored
11
env/posix/ocf_env.h
vendored
@ -195,9 +195,18 @@ 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)
|
static inline uint64_t env_get_free_memory(void)
|
||||||
{
|
{
|
||||||
return (uint64_t)(-1);
|
struct sysinfo info;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = sysinfo(&info);
|
||||||
|
if (ret != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (uint64_t)info.totalram * info.mem_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ALLOCATOR */
|
/* ALLOCATOR */
|
||||||
|
Loading…
Reference in New Issue
Block a user