Updated Branches: refs/heads/sortex_ptr_only 7310e7706 -> 6384d8984
Change type of SortEx members. Change slice_starts and scratch to limit element types to Obj. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/6384d898 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/6384d898 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/6384d898 Branch: refs/heads/sortex_ptr_only Commit: 6384d8984c17d02ec240133870e0e37c61eac118 Parents: 07a6c3c Author: Marvin Humphrey <[email protected]> Authored: Tue Jan 8 14:24:14 2013 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Tue Jan 8 15:23:38 2013 -0800 ---------------------------------------------------------------------- core/Lucy/Util/SortExternal.c | 12 ++++++------ core/Lucy/Util/SortExternal.cfh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/6384d898/core/Lucy/Util/SortExternal.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c index 7ef1cf4..1632f53 100644 --- a/core/Lucy/Util/SortExternal.c +++ b/core/Lucy/Util/SortExternal.c @@ -125,7 +125,7 @@ SortEx_sort_cache(SortExternal *self) { = (Lucy_Sort_Compare_t)METHOD_PTR(vtable, Lucy_SortEx_Compare); if (self->scratch_cap < self->cache_cap) { self->scratch_cap = self->cache_cap; - self->scratch = (uint8_t*)REALLOCATE( + self->scratch = (Obj**)REALLOCATE( self->scratch, self->scratch_cap * sizeof(Obj*)); } @@ -147,9 +147,9 @@ SortEx_add_run(SortExternal *self, SortExternal *run) { self->slice_sizes = (uint32_t*)REALLOCATE( self->slice_sizes, num_runs * sizeof(uint32_t)); - self->slice_starts = (uint8_t**)REALLOCATE( + self->slice_starts = (Obj**)REALLOCATE( self->slice_starts, - num_runs * sizeof(uint8_t*)); + num_runs * sizeof(Obj*)); } static void @@ -210,7 +210,7 @@ S_find_endpost(SortExternal *self) { static void S_absorb_slices(SortExternal *self, uint8_t *endpost) { uint32_t num_runs = VA_Get_Size(self->runs); - uint8_t **slice_starts = self->slice_starts; + Obj **slice_starts = self->slice_starts; uint32_t *slice_sizes = self->slice_sizes; VTable *vtable = SortEx_Get_VTable(self); Lucy_Sort_Compare_t compare @@ -244,7 +244,7 @@ S_absorb_slices(SortExternal *self, uint8_t *endpost) { // Transform slice starts from ticks to pointers. uint32_t total = 0; for (uint32_t i = 0; i < self->num_slices; i++) { - slice_starts[i] = self->cache + total * sizeof(Obj*); + slice_starts[i] = (Obj*)(self->cache + total * sizeof(Obj*)); total += slice_sizes[i]; } @@ -252,7 +252,7 @@ S_absorb_slices(SortExternal *self, uint8_t *endpost) { // but exploit the fact that each slice is already sorted. if (self->scratch_cap < self->cache_cap) { self->scratch_cap = self->cache_cap; - self->scratch = (uint8_t*)REALLOCATE( + self->scratch = (Obj**)REALLOCATE( self->scratch, self->scratch_cap * sizeof(Obj*)); } http://git-wip-us.apache.org/repos/asf/lucy/blob/6384d898/core/Lucy/Util/SortExternal.cfh ---------------------------------------------------------------------- diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh index fa6be96..eb9a2b0 100644 --- a/core/Lucy/Util/SortExternal.cfh +++ b/core/Lucy/Util/SortExternal.cfh @@ -53,11 +53,11 @@ abstract class Lucy::Util::SortExternal cnick SortEx uint32_t cache_cap; uint32_t cache_max; uint32_t cache_tick; - uint8_t *scratch; + Obj **scratch; uint32_t scratch_cap; VArray *runs; uint32_t num_slices; - uint8_t **slice_starts; + Obj **slice_starts; uint32_t *slice_sizes; uint32_t mem_thresh; bool flipped;
