[Tinyos-2-commits] CVS: tinyos-2.x/tos/system PoolP.nc, 1.1.2.3,
1.1.2.4
Phil Levis
scipio at users.sourceforge.net
Tue Oct 3 01:54:23 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/system
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2782
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
PoolP.nc
Log Message:
Equality tests are not as elegant as mod, but gosh are they
cheaper
Index: PoolP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/system/PoolP.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** PoolP.nc 20 Jul 2006 20:15:42 -0000 1.1.2.3
--- PoolP.nc 3 Oct 2006 08:54:20 -0000 1.1.2.4
***************
*** 89,93 ****
queue[index] = NULL;
free--;
! index = (index + 1) % size;
return rval;
}
--- 89,96 ----
queue[index] = NULL;
free--;
! index++;
! if (index == size) {
! index = 0;
! }
return rval;
}
***************
*** 100,104 ****
}
else {
! uint8_t emptyIndex = (index + free) % size;
queue[emptyIndex] = newVal;
free++;
--- 103,110 ----
}
else {
! uint8_t emptyIndex = (index + free);
! if (emptyIndex >= size) {
! emptyIndex -= size;
! }
queue[emptyIndex] = newVal;
free++;
More information about the Tinyos-2-commits
mailing list