# HG changeset patch # User Me # Date 1280183217 25200 # Node ID f6b960f400051199cd49f30074b78a41b09e0dd2 # Parent 06ca89bafbb8cd5e7b387808b6fdedc4c6a7766d Debugging -- middle of debugging frenzy before PPoPP deadline diff -r 06ca89bafbb8 -r f6b960f40005 VMSHW_PluginFns.c --- a/VMSHW_PluginFns.c Wed Jul 07 13:15:29 2010 -0700 +++ b/VMSHW_PluginFns.c Mon Jul 26 15:26:57 2010 -0700 @@ -8,7 +8,6 @@ #include #include -#include "VMS/VMS.h" #include "VMS/Queue_impl/PrivateQueue.h" #include "VMSHW.h" #include "VMSHW_Request_Handlers.h" @@ -39,7 +38,7 @@ if( VMS__isSemanticReqst( req ) ) { semReq = VMS__take_sem_reqst_from( req ); - if( semReq == NULL ) goto DoneWithReqst; + if( semReq == NULL ) goto DoneHandlingReqst; switch( semReq->reqType ) { case send_type: handleSendType( semReq, semEnv); @@ -57,6 +56,7 @@ VMSHW__free_semantic_request( semReq ); break; } + //NOTE: freeing semantic request data strucs handled inside these } else if( VMS__isCreateReqst( req ) ) //only plugin can add to ready Q { VirtProcr * @@ -81,9 +81,12 @@ writePrivQ( shutdownPr, semEnv->readyVirtProcrQ ); } } - - DoneWithReqst: - VMS__free_request( req ); + + DoneHandlingReqst: + //Free VMS portion of request, no matter what -- sem request data + // struc instances may still be around.. VMS__free_request doesn't + // affect the semantic request that was carried by it + VMS__free_request( req ); req = VMS__take_top_request_from( requestingPr ); } //while( req != NULL ) } diff -r 06ca89bafbb8 -r f6b960f40005 VMSHW_Request_Handlers.c --- a/VMSHW_Request_Handlers.c Wed Jul 07 13:15:29 2010 -0700 +++ b/VMSHW_Request_Handlers.c Mon Jul 26 15:26:57 2010 -0700 @@ -19,7 +19,7 @@ // Helpers HashEntry * -lookupReqAndGiveEntryElseInsertIfEmpty( char *key, VMSHWSemReq *semReq, +giveEntryElseInsertReqst( char *key, VMSHWSemReq *semReq, HashTable *commHashTbl ) { HashEntry *entry; VMSHWSemReq *waitingReq; @@ -80,9 +80,9 @@ //TODO: use a faster hash function -- see notes in intelligence gather key[0] = (int)receivePr; key[1] = (int)(semReq->msgType); - //key[2] acts at the 0 that terminates the string + //key[2] acts as the 0 that terminates the string - entry = lookupReqAndGiveEntryElseInsertIfEmpty( key, semReq, commHashTbl); + entry = giveEntryElseInsertReqst( key, semReq, commHashTbl); if( entry == NULL ) return; //was just inserted waitingReq = (VMSHWSemReq *)entry->content; @@ -112,7 +112,7 @@ receivePr->semanticData = semReq->msg; //bring both processors back from suspend - writePrivQ( sendPr, semEnv->readyVirtProcrQ ); + writePrivQ( sendPr, semEnv->readyVirtProcrQ ); writePrivQ( receivePr, semEnv->readyVirtProcrQ ); //don't need semReq anymore -- free it @@ -141,7 +141,7 @@ key[1] = (int)sendPr; //key[2] acts at the 0 that terminates the string - entry = lookupReqAndGiveEntryElseInsertIfEmpty( key, semReq, commHashTbl); + entry = giveEntryElseInsertReqst( key, semReq, commHashTbl); if( entry == NULL ) return; //was just inserted waitingReq = (VMSHWSemReq *)entry->content; @@ -225,7 +225,7 @@ //key[2] acts at the 0 that terminates the string - entry = lookupReqAndGiveEntryElseInsertIfEmpty( key, semReq, commHashTbl); + entry = giveEntryElseInsertReqst( key, semReq, commHashTbl); if( entry == NULL ) return; //was just inserted waitingReq = (VMSHWSemReq *)entry->content; @@ -273,7 +273,7 @@ key[1] = (int)sendPr; //key[2] acts at the 0 that terminates the string - entry = lookupReqAndGiveEntryElseInsertIfEmpty( key, semReq, commHashTbl); + entry = giveEntryElseInsertReqst( key, semReq, commHashTbl); if( entry == NULL ) return; //was just inserted waitingReq = (VMSHWSemReq *)entry->content; diff -r 06ca89bafbb8 -r f6b960f40005 VMSHW_lib.c --- a/VMSHW_lib.c Wed Jul 07 13:15:29 2010 -0700 +++ b/VMSHW_lib.c Mon Jul 26 15:26:57 2010 -0700 @@ -186,7 +186,9 @@ void * VMSHW__malloc_size_to( int numBytes, VirtProcr *ownerPr ) { - +//TODO: Put in the ownership system from DKU -- have it working, just adapt +// it to here + return malloc( numBytes ); }