Merge pull request #823 from mmichal10/fix-ram-check
Revert "Unstubify RAM check in posix evn"
This commit is contained in:
commit
d2fcd27d7a
11
env/posix/ocf_env.h
vendored
11
env/posix/ocf_env.h
vendored
@ -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)
|
static inline uint64_t env_get_free_memory(void)
|
||||||
{
|
{
|
||||||
struct sysinfo info;
|
return (uint64_t)(-1);
|
||||||
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