소스 검색

[Pal/*] Remove misleading/old comments in _DkVirtualMemoryAlloc

The comment said "The memory should have MAP_PRIVATE and MAP_ANONYMOUS"
but depending on the alloc_type parameter the mapping won't be private.
That the mapping will be anonymous is obvious so remove the comment
completely.

Also remove a leftover comment from the initial port to SGX.
Simon Gaiser 6 년 전
부모
커밋
75801b0cc7
3개의 변경된 파일0개의 추가작업 그리고 8개의 파일을 삭제
  1. 0 1
      Pal/src/host/FreeBSD/db_memory.c
  2. 0 6
      Pal/src/host/Linux-SGX/db_memory.c
  3. 0 1
      Pal/src/host/Linux/db_memory.c

+ 0 - 1
Pal/src/host/FreeBSD/db_memory.c

@@ -48,7 +48,6 @@ int _DkVirtualMemoryAlloc (void ** paddr, uint64_t size, int alloc_type,
     int flags = HOST_FLAGS(alloc_type, prot|PAL_PROT_WRITECOPY);
     int flags = HOST_FLAGS(alloc_type, prot|PAL_PROT_WRITECOPY);
     prot = HOST_PROT(prot);
     prot = HOST_PROT(prot);
 
 
-    /* The memory should have MAP_PRIVATE and MAP_ANONYMOUS */
     flags |= MAP_ANONYMOUS|(addr ? MAP_FIXED : 0);
     flags |= MAP_ANONYMOUS|(addr ? MAP_FIXED : 0);
     mem = (void *) ARCH_MMAP(addr, size, prot, flags, -1, 0);
     mem = (void *) ARCH_MMAP(addr, size, prot, flags, -1, 0);
 
 

+ 0 - 6
Pal/src/host/Linux-SGX/db_memory.c

@@ -70,12 +70,6 @@ int _DkVirtualMemoryAlloc (void ** paddr, uint64_t size, int alloc_type, int pro
 {
 {
     void * addr = *paddr, * mem;
     void * addr = *paddr, * mem;
 
 
-    //int flags = HOST_FLAGS(alloc_type, prot|PAL_PROT_WRITECOPY);
-    //prot = HOST_PROT(prot);
-    /* The memory should have MAP_PRIVATE and MAP_ANONYMOUS */
-    //flags |= MAP_ANONYMOUS|(addr ? MAP_FIXED : 0);
-    //mem = (void *) ARCH_MMAP(addr, size, prot, flags, -1, 0);
-
     if ((alloc_type & PAL_ALLOC_INTERNAL) && addr)
     if ((alloc_type & PAL_ALLOC_INTERNAL) && addr)
         return -PAL_ERROR_INVAL;
         return -PAL_ERROR_INVAL;
 
 

+ 0 - 1
Pal/src/host/Linux/db_memory.c

@@ -48,7 +48,6 @@ int _DkVirtualMemoryAlloc (void ** paddr, uint64_t size, int alloc_type,
     int flags = HOST_FLAGS(alloc_type, prot|PAL_PROT_WRITECOPY);
     int flags = HOST_FLAGS(alloc_type, prot|PAL_PROT_WRITECOPY);
     prot = HOST_PROT(prot);
     prot = HOST_PROT(prot);
 
 
-    /* The memory should have MAP_PRIVATE and MAP_ANONYMOUS */
     flags |= MAP_ANONYMOUS|(addr ? MAP_FIXED : 0);
     flags |= MAP_ANONYMOUS|(addr ? MAP_FIXED : 0);
     mem = (void *) ARCH_MMAP(addr, size, prot, flags, -1, 0);
     mem = (void *) ARCH_MMAP(addr, size, prot, flags, -1, 0);