diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/eina/src/modules/mp/buddy/eina_buddy.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/eina/src/modules/mp/buddy/eina_buddy.c')
-rw-r--r-- | libraries/eina/src/modules/mp/buddy/eina_buddy.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libraries/eina/src/modules/mp/buddy/eina_buddy.c b/libraries/eina/src/modules/mp/buddy/eina_buddy.c index f402c6f..7d830db 100644 --- a/libraries/eina/src/modules/mp/buddy/eina_buddy.c +++ b/libraries/eina/src/modules/mp/buddy/eina_buddy.c | |||
@@ -133,23 +133,23 @@ static void _free(void *data, void *element) | |||
133 | Buddy *b = data; | 133 | Buddy *b = data; |
134 | Block *block, *buddy; | 134 | Block *block, *buddy; |
135 | size_t offset; | 135 | size_t offset; |
136 | size_t index; | 136 | size_t idx; |
137 | 137 | ||
138 | offset = (unsigned char *)element - (unsigned char *)b->heap; | 138 | offset = (unsigned char *)element - (unsigned char *)b->heap; |
139 | if (offset > b->size) | 139 | if (offset > b->size) |
140 | return; | 140 | return; |
141 | 141 | ||
142 | index = offset >> b->min_order; | 142 | idx = offset >> b->min_order; |
143 | block = &b->blocks[index]; | 143 | block = &b->blocks[idx]; |
144 | 144 | ||
145 | //printf("free %x index = %d order = %d buddy = %d\n", offset, index, block->order, index ^ (1 << block->order)); | 145 | //printf("free %x idx = %d order = %d buddy = %d\n", offset, idx, block->order, idx ^ (1 << block->order)); |
146 | /* we should always work with the buddy at right */ | 146 | /* we should always work with the buddy at right */ |
147 | if (index & (1 << block->order)) | 147 | if (idx & (1 << block->order)) |
148 | { | 148 | { |
149 | Block *left; | 149 | Block *left; |
150 | 150 | ||
151 | index = index ^ (1 << block->order); | 151 | idx = idx ^ (1 << block->order); |
152 | left = &b->blocks[index]; | 152 | left = &b->blocks[idx]; |
153 | if (!left->available) | 153 | if (!left->available) |
154 | goto end; | 154 | goto end; |
155 | else | 155 | else |
@@ -170,7 +170,7 @@ check: | |||
170 | 170 | ||
171 | } | 171 | } |
172 | 172 | ||
173 | buddy = &b->blocks[index ^ (1 << block->order)]; | 173 | buddy = &b->blocks[idx ^ (1 << block->order)]; |
174 | if (!buddy->available) | 174 | if (!buddy->available) |
175 | { | 175 | { |
176 | goto end; /* merge two blocks */ | 176 | goto end; /* merge two blocks */ |
@@ -239,7 +239,7 @@ static void _statistics(void *data) | |||
239 | 239 | ||
240 | printf("Information:\n"); | 240 | printf("Information:\n"); |
241 | printf( | 241 | printf( |
242 | "size = %li, min_order = %d, max_order = %d, num_order = %d, num_blocks = %d (%luKB)\n", | 242 | "size = %zu, min_order = %d, max_order = %d, num_order = %d, num_blocks = %d (%uKB)\n", |
243 | b->size, | 243 | b->size, |
244 | b->min_order, | 244 | b->min_order, |
245 | b->max_order, | 245 | b->max_order, |
@@ -255,7 +255,7 @@ static void _statistics(void *data) | |||
255 | printf("\n2^%d:", b->min_order + i); | 255 | printf("\n2^%d:", b->min_order + i); |
256 | EINA_INLIST_FOREACH(b->areas[i], block) | 256 | EINA_INLIST_FOREACH(b->areas[i], block) |
257 | { | 257 | { |
258 | printf(" %li", (block - &b->blocks[0])); | 258 | printf(" %d", (block - &b->blocks[0])); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | printf("\nBlocks dumping:\n"); | 261 | printf("\nBlocks dumping:\n"); |