Implement secure alloc/free using vmalloc/vfree
In kernel there is no point in mlocking and zeroring memory before freeing. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
0cddcb6f5f
commit
79eb92cd9a
@ -55,6 +55,16 @@ static inline void env_vfree(const void *ptr)
|
|||||||
cas_vfree(ptr);
|
cas_vfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void *env_secure_alloc(size_t size)
|
||||||
|
{
|
||||||
|
return env_vmalloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void env_secure_free(const void *ptr, size_t size)
|
||||||
|
{
|
||||||
|
env_vfree(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/* *** ALLOCATOR *** */
|
/* *** ALLOCATOR *** */
|
||||||
|
|
||||||
typedef struct _env_allocator env_allocator;
|
typedef struct _env_allocator env_allocator;
|
||||||
|
Loading…
Reference in New Issue
Block a user