comparison src/ralloc.c @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children ac0620f6398e
comparison
equal deleted inserted replaced
73:e2d7a37b7c8d 74:54cc21c15cbb
912 purpose. [ACP Vol I]. We can't use the workaround of using a 912 purpose. [ACP Vol I]. We can't use the workaround of using a
913 randomized first fit because we don't want to presume too much 913 randomized first fit because we don't want to presume too much
914 about the memory map. Instead, we try to coalesce empty or 914 about the memory map. Instead, we try to coalesce empty or
915 unavailable blocks at any available opportunity. */ 915 unavailable blocks at any available opportunity. */
916 916
917 static void Addr_Block_initialize(); /* Initialization procedure for address picking scheme */ 917 /* Initialization procedure for address picking scheme */
918 static VM_ADDR New_Addr_Block( SIZE sz ); /* Get a suitable VM_ADDR via mmap */ 918 static void Addr_Block_initialize(void);
919 static void Free_Addr_Block( VM_ADDR addr, SIZE sz ); /* Free a VM_ADDR allocated via New_Addr_Block */ 919
920 /* Get a suitable VM_ADDR via mmap */
921 static VM_ADDR New_Addr_Block( SIZE sz );
922
923 /* Free a VM_ADDR allocated via New_Addr_Block */
924 static void Free_Addr_Block( VM_ADDR addr, SIZE sz );
920 925
921 #ifdef MMAP_GENERATE_ADDRESSES 926 #ifdef MMAP_GENERATE_ADDRESSES
922 /* Implementation of the three calls for address picking when XEmacs is incharge */ 927 /* Implementation of the three calls for address picking when XEmacs is incharge */
923 928
924 /* The enum denotes the status of the following block. */ 929 /* The enum denotes the status of the following block. */
1033 } 1038 }
1034 #else /* !MMAP_GENERATE_ADDRESSES */ 1039 #else /* !MMAP_GENERATE_ADDRESSES */
1035 /* This is an alternate (simpler) implementation in cases where the 1040 /* This is an alternate (simpler) implementation in cases where the
1036 address is picked by the kernel. */ 1041 address is picked by the kernel. */
1037 1042
1038 static void Addr_Block_initialize() 1043 static void Addr_Block_initialize(void)
1039 {} /* Nothing. */ 1044 {
1045 /* Nothing. */
1046 }
1040 1047
1041 static VM_ADDR New_Addr_Block( SIZE sz ) 1048 static VM_ADDR New_Addr_Block( SIZE sz )
1042 { 1049 {
1043 return mmap( 0, sz, PROT_READ|PROT_WRITE, MAP_FLAGS, 1050 return mmap( 0, sz, PROT_READ|PROT_WRITE, MAP_FLAGS,
1044 DEV_ZERO_FD, 0 ); 1051 DEV_ZERO_FD, 0 );