mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 05:41:37 +00:00
[Pal/Linux-SGX] Remove redundant memset in _DkVirtualMemoryAlloc()
There is already one memset in get_enclave_pages() controlled by manifest option `sgx.zero_heap_on_demand`. So the explicit memset in _DkVirtualMemoryAlloc() is not needed. Observed perf improvement is 30% on a worst-case micro-benchmark with mmap().
This commit is contained in:
@@ -54,8 +54,6 @@ int _DkVirtualMemoryAlloc(void** paddr, uint64_t size, int alloc_type, int prot)
|
||||
if (!mem)
|
||||
return addr ? -PAL_ERROR_DENIED : -PAL_ERROR_NOMEM;
|
||||
|
||||
memset(mem, 0, size);
|
||||
|
||||
*paddr = mem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user