Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff VMS.c @ 201:0320b49ca013
New include paths because of new project structure
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Mon, 13 Feb 2012 19:35:32 +0100 |
| parents | de5e7c522f1f |
| children |
line diff
1.1 --- a/VMS.c Fri Feb 03 19:04:12 2012 +0100 1.2 +++ b/VMS.c Mon Feb 13 19:35:32 2012 +0100 1.3 @@ -13,8 +13,8 @@ 1.4 1.5 #include "VMS.h" 1.6 #include "ProcrContext.h" 1.7 -#include "Queue_impl/BlockingQueue.h" 1.8 -#include "Histogram/Histogram.h" 1.9 +#include "C_Libraries/Queue_impl/BlockingQueue.h" 1.10 +#include "C_Libraries/Histogram/Histogram.h" 1.11 1.12 1.13 #define thdAttrs NULL 1.14 @@ -105,7 +105,7 @@ 1.15 1.16 //Very first thing put into the master env is the free-list, seeded 1.17 // with a massive initial chunk of memory. 1.18 - //After this, all other mallocs are VMS__malloc. 1.19 + //After this, all other mallocs are VMS_int__malloc. 1.20 _VMSMasterEnv->freeLists = VMS_ext__create_free_list(); 1.21 1.22 1.23 @@ -124,15 +124,15 @@ 1.24 #endif 1.25 //======================================================================== 1.26 1.27 - //===================== Only VMS__malloc after this ==================== 1.28 + //===================== Only VMS_int__malloc after this ==================== 1.29 masterEnv = (MasterEnv*)_VMSMasterEnv; 1.30 1.31 //Make a readyToAnimateQ for each core loop 1.32 - readyToAnimateQs = VMS__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); 1.33 - masterVPs = VMS__malloc( NUM_CORES * sizeof(VirtProcr *) ); 1.34 + readyToAnimateQs = VMS_int__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); 1.35 + masterVPs = VMS_int__malloc( NUM_CORES * sizeof(VirtProcr *) ); 1.36 1.37 //One array for each core, 3 in array, core's masterVP scheds all 1.38 - allSchedSlots = VMS__malloc( NUM_CORES * sizeof(SchedSlot *) ); 1.39 + allSchedSlots = VMS_int__malloc( NUM_CORES * sizeof(SchedSlot *) ); 1.40 1.41 _VMSMasterEnv->numProcrsCreated = 0; //used by create procr 1.42 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 1.43 @@ -162,7 +162,7 @@ 1.44 _VMSMasterEnv->dynIntervalProbesInfo = 1.45 makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->intervalProbes), 200); 1.46 1.47 - _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS__free ); 1.48 + _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS_int__free ); 1.49 1.50 //put creation time directly into master env, for fast retrieval 1.51 struct timeval timeStamp; 1.52 @@ -187,12 +187,12 @@ 1.53 { SchedSlot **schedSlots; 1.54 int i; 1.55 1.56 - //schedSlots = VMS__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); 1.57 + //schedSlots = VMS_int__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); 1.58 posix_memalign(&schedSlots, CACHELINE_SIZE, NUM_SCHED_SLOTS * sizeof(SchedSlot *)); 1.59 1.60 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 1.61 { 1.62 - //schedSlots[i] = VMS__malloc( sizeof(SchedSlot) ); 1.63 + //schedSlots[i] = VMS_int__malloc( sizeof(SchedSlot) ); 1.64 posix_memalign(&schedSlots[i], CACHELINE_SIZE, CACHELINE_SIZE ); 1.65 1.66 //Set state to mean "handling requests done, slot needs filling" 1.67 @@ -208,9 +208,9 @@ 1.68 { int i; 1.69 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 1.70 { 1.71 - VMS__free( schedSlots[i] ); 1.72 + VMS_int__free( schedSlots[i] ); 1.73 } 1.74 - VMS__free( schedSlots ); 1.75 + VMS_int__free( schedSlots ); 1.76 } 1.77 1.78 1.79 @@ -228,7 +228,7 @@ 1.80 1.81 //Make the threads that animate the core loops 1.82 for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ) 1.83 - { coreLoopThdParams[coreIdx] = VMS__malloc( sizeof(ThdParams) ); 1.84 + { coreLoopThdParams[coreIdx] = VMS_int__malloc( sizeof(ThdParams) ); 1.85 coreLoopThdParams[coreIdx]->coreNum = coreIdx; 1.86 1.87 retCode = 1.88 @@ -293,7 +293,7 @@ 1.89 posix_memalign((void*)&newPr, CACHELINE_SIZE, sizeof(VirtProcr) ); //align to cacheline 1.90 posix_memalign(&stackLocs, CACHELINE_SIZE, VIRT_PROCR_STACK_SIZE ); //align to cacheline 1.91 if( stackLocs == 0 ) 1.92 - { perror("VMS__malloc stack"); exit(1); } 1.93 + { perror("VMS_int__malloc stack"); exit(1); } 1.94 1.95 return create_procr_helper( newPr, fnPtr, initialData, stackLocs ); 1.96 } 1.97 @@ -437,7 +437,7 @@ 1.98 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate ) 1.99 { 1.100 //NOTE: initialData was given to the processor, so should either have 1.101 - // been alloc'd with VMS__malloc, or freed by the level above animPr. 1.102 + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. 1.103 //So, all that's left to free here is the stack and the VirtProcr struc 1.104 // itself 1.105 //Note, should not stack-allocate initial data -- no guarantee, in 1.106 @@ -456,14 +456,14 @@ 1.107 * be malloc'd if this is called inside the same call chain before the 1.108 * send of the last request is called. 1.109 * 1.110 - *The request handler has to call VMS__free_VMSReq for any of these 1.111 + *The request handler has to call VMS_int__free_VMSReq for any of these 1.112 */ 1.113 inline void 1.114 VMS__add_sem_request_in_mallocd_VMSReqst( void *semReqData, 1.115 VirtProcr *callingPr ) 1.116 { VMSReqst *req; 1.117 1.118 - req = VMS__malloc( sizeof(VMSReqst) ); 1.119 + req = VMS_int__malloc( sizeof(VMSReqst) ); 1.120 req->reqType = semantic; 1.121 req->semReqData = semReqData; 1.122 req->nextReqst = callingPr->requests; 1.123 @@ -545,8 +545,8 @@ 1.124 1.125 semReq = req->semReqData; 1.126 1.127 - newProbe = VMS__malloc( sizeof(IntervalProbe) ); 1.128 - newProbe->nameStr = VMS__strDup( semReq->nameStr ); 1.129 + newProbe = VMS_int__malloc( sizeof(IntervalProbe) ); 1.130 + newProbe->nameStr = VMS_int__strDup( semReq->nameStr ); 1.131 newProbe->hist = NULL; 1.132 newProbe->schedChoiceWasRecorded = FALSE; 1.133 1.134 @@ -574,7 +574,7 @@ 1.135 * VMS_malloc mechanism. Then it calls this, which first asks the malloc 1.136 * system to disown any state that did use VMS_malloc, and then frees the 1.137 * statck and the processor-struct itself. 1.138 - *If the dissipated processor is the sole (remaining) owner of VMS__malloc'd 1.139 + *If the dissipated processor is the sole (remaining) owner of VMS_int__malloc'd 1.140 * state, then that state gets freed (or sent to recycling) as a side-effect 1.141 * of dis-owning it. 1.142 */ 1.143 @@ -583,11 +583,11 @@ 1.144 { 1.145 //dis-own all locations owned by this processor, causing to be freed 1.146 // any locations that it is (was) sole owner of 1.147 -//TODO: implement VMS__malloc system, including "give up ownership" 1.148 +//TODO: implement VMS_int__malloc system, including "give up ownership" 1.149 1.150 1.151 //NOTE: initialData was given to the processor, so should either have 1.152 - // been alloc'd with VMS__malloc, or freed by the level above animPr. 1.153 + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. 1.154 //So, all that's left to free here is the stack and the VirtProcr struc 1.155 // itself 1.156 //Note, should not stack-allocate initial data -- no guarantee, in 1.157 @@ -617,7 +617,7 @@ 1.158 * masterVP any AppVPs that might still be allocated and sitting in the 1.159 * semantic environment, or have been orphaned in the _VMSWorkQ. 1.160 * 1.161 - *NOTE: the semantic plug-in is expected to use VMS__malloc to get all the 1.162 + *NOTE: the semantic plug-in is expected to use VMS_int__malloc to get all the 1.163 * locations it needs, and give ownership to masterVP. Then, they will be 1.164 * automatically freed. 1.165 * 1.166 @@ -729,7 +729,7 @@ 1.167 } 1.168 #endif 1.169 1.170 - //All the environment data has been allocated with VMS__malloc, so just 1.171 + //All the environment data has been allocated with VMS_int__malloc, so just 1.172 // free its internal big-chunk and all inside it disappear. 1.173 /* 1.174 readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs; 1.175 @@ -745,13 +745,13 @@ 1.176 freeSchedSlots( allSchedSlots[ coreIdx ] ); 1.177 } 1.178 1.179 - VMS__free( _VMSMasterEnv->readyToAnimateQs ); 1.180 - VMS__free( _VMSMasterEnv->masterVPs ); 1.181 - VMS__free( _VMSMasterEnv->allSchedSlots ); 1.182 + VMS_int__free( _VMSMasterEnv->readyToAnimateQs ); 1.183 + VMS_int__free( _VMSMasterEnv->masterVPs ); 1.184 + VMS_int__free( _VMSMasterEnv->allSchedSlots ); 1.185 1.186 //============================= MEASUREMENT STUFF ======================== 1.187 #ifdef STATS__TURN_ON_PROBES 1.188 - freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS__free_probe); 1.189 + freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_int__free_probe); 1.190 #endif 1.191 //======================================================================== 1.192 */
