*** empty log message ***
This commit is contained in:
parent
d67ad3940e
commit
27b4accdd9
3 changed files with 14 additions and 6 deletions
|
@ -192,11 +192,19 @@ void * msgAllocate(msgSpace *space,
|
||||||
int bufferFreeSize;
|
int bufferFreeSize;
|
||||||
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize;
|
||||||
printf("BufferSize : %d", bufferFreeSize);
|
printf("BufferSize : %d", bufferFreeSize);
|
||||||
resultAddr = mmap( NULL,
|
|
||||||
|
// on mappe la totalité du pool
|
||||||
|
resultAddr = mmap( NULL,
|
||||||
bufferFreeSize,
|
bufferFreeSize,
|
||||||
PROT_READ | PROT_WRITE,
|
PROT_READ | PROT_WRITE,
|
||||||
MAP_SHARED, mSPoolFd,
|
MAP_SHARED, mSPoolFd,
|
||||||
(off_t)0); // bufferFreeSize*bufferFreeIndex );
|
(off_t)0);
|
||||||
|
int bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
|
||||||
|
|
||||||
|
mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE);
|
||||||
|
mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE);
|
||||||
|
|
||||||
|
//(bufferFreeSize*bufferFreeIndex) );
|
||||||
if( resultAddr == MAP_FAILED) {
|
if( resultAddr == MAP_FAILED) {
|
||||||
NZG_ERROR("resultAddr mmap","");
|
NZG_ERROR("resultAddr mmap","");
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
|
|
|
@ -11,6 +11,7 @@ int msgBufferDetachProc(
|
||||||
msgBufferInfo * bufferInfoTabAddr;
|
msgBufferInfo * bufferInfoTabAddr;
|
||||||
int bufferInfoNb;
|
int bufferInfoNb;
|
||||||
|
|
||||||
|
printf("Detaching %d,%d\n",poolIndex,bufferIndex);
|
||||||
//récuperer l'ID du BufferInfoTab;
|
//récuperer l'ID du BufferInfoTab;
|
||||||
strcpy(bufferInfoTabId, poolDataTabAddr[poolIndex].bufferInfoTabId);
|
strcpy(bufferInfoTabId, poolDataTabAddr[poolIndex].bufferInfoTabId);
|
||||||
|
|
||||||
|
@ -23,7 +24,7 @@ int msgBufferDetachProc(
|
||||||
/** on regarde dans le tableau d'infos de buffer **/
|
/** on regarde dans le tableau d'infos de buffer **/
|
||||||
bufferInfoNb=poolDataTabAddr[poolIndex].bufferNb;
|
bufferInfoNb=poolDataTabAddr[poolIndex].bufferNb;
|
||||||
bufferInfoTabAddr=mmap(NULL,bufferInfoNb*sizeof(msgBufferInfo),
|
bufferInfoTabAddr=mmap(NULL,bufferInfoNb*sizeof(msgBufferInfo),
|
||||||
PROT_READ,MAP_SHARED,bufferInfoTabFd,(off_t)0);
|
PROT_READ|PROT_WRITE,MAP_SHARED,bufferInfoTabFd,(off_t)0);
|
||||||
|
|
||||||
bufferInfoTabAddr[bufferIndex].ownerPid = (pid_t)-1;
|
bufferInfoTabAddr[bufferIndex].ownerPid = (pid_t)-1;
|
||||||
bufferInfoTabAddr[bufferIndex].addr = NULL;
|
bufferInfoTabAddr[bufferIndex].addr = NULL;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "libnazgul.h"
|
#include "libnazgul.h"
|
||||||
|
|
||||||
int msgFree(msgSpace * space, void * addr){
|
int msgFree(msgSpace * space, void * addr){
|
||||||
printf("Freeee de :0x%08x\n",(int)addr);
|
printf("[ FREE 0x%08x ]\n",(int)addr);
|
||||||
|
|
||||||
int poolIndex;
|
int poolIndex;
|
||||||
int bufferIndex;
|
int bufferIndex;
|
||||||
|
@ -59,8 +59,7 @@ sem_t * poolDataTabSemFd;
|
||||||
|
|
||||||
printf("Found : %d\n",err);
|
printf("Found : %d\n",err);
|
||||||
printf("Freing pool: %d, buffer: %d\n",poolIndex,bufferIndex);
|
printf("Freing pool: %d, buffer: %d\n",poolIndex,bufferIndex);
|
||||||
//msgBufferDetachProc(poolDataTabAddr,poolIndex,bufferIndex,addr);
|
msgBufferDetachProc(poolDataTabAddr,poolIndex,bufferIndex,addr);
|
||||||
printf("FREE-SEMWAIT\n");
|
|
||||||
|
|
||||||
/* unmapper le msgPoolDataTab */
|
/* unmapper le msgPoolDataTab */
|
||||||
munmap(poolDataTabAddr,(space->poolNb) * sizeof( msgPoolData ));
|
munmap(poolDataTabAddr,(space->poolNb) * sizeof( msgPoolData ));
|
||||||
|
|
Loading…
Reference in a new issue