You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ka...@apache.org on 2011/11/17 03:20:15 UTC
[lucy-commits] svn commit: r1203023 - /incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c
Author: karpet
Date: Thu Nov 17 02:20:14 2011
New Revision: 1203023
URL: http://svn.apache.org/viewvc?rev=1203023&view=rev
Log:
apply patch c99_patch01.patch from Logan Bell, submitted to JIRA LUCY-148
at https://issues.apache.org/jira/browse/LUCY-148
Modified:
incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c
Modified: incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c?rev=1203023&r1=1203022&r2=1203023&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/MemoryPool.c Thu Nov 17 02:20:14 2011
@@ -61,7 +61,6 @@ MemPool_destroy(MemoryPool *self) {
static void
S_init_arena(MemoryPool *self, size_t amount) {
ByteBuf *bb;
- int32_t i;
// Indicate which arena we're using at present.
self->tick++;
@@ -86,7 +85,7 @@ S_init_arena(MemoryPool *self, size_t am
// Recalculate consumption to take into account blocked off space.
self->consumed = 0;
- for (i = 0; i < self->tick; i++) {
+ for (int32_t i = 0; i < self->tick; i++) {
ByteBuf *bb = (ByteBuf*)VA_Fetch(self->arenas, i);
self->consumed += BB_Get_Size(bb);
}
@@ -151,13 +150,12 @@ MemPool_release_all(MemoryPool *self) {
void
MemPool_eat(MemoryPool *self, MemoryPool *other) {
- int32_t i;
if (self->buf != NULL) {
THROW(ERR, "Memory pool is not empty");
}
// Move active arenas from other to self.
- for (i = 0; i <= other->tick; i++) {
+ for (int32_t i = 0; i <= other->tick; i++) {
ByteBuf *arena = (ByteBuf*)VA_Shift(other->arenas);
// Maybe displace existing arena.
VA_Store(self->arenas, i, (Obj*)arena);