lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [45/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change type of SortEx members.
Date Sat, 26 Apr 2014 23:12:15 GMT
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/90cfcac8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/90cfcac8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/90cfcac8

Branch: refs/heads/sortex_ptr_only
Commit: 90cfcac84a776fdd0555711f40f7e280eb739be3
Parents: 9ed7692
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Tue Jan 8 14:24:14 2013 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Sat Apr 26 12:01:25 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/SortExternal.c   | 14 +++++++-------
 core/Lucy/Util/SortExternal.cfh |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/90cfcac8/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 9f0c30e..4d68664 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -136,8 +136,8 @@ SortEx_Sort_Cache_IMP(SortExternal *self) {
         if (ivars->scratch_cap < ivars->cache_cap) {
             ivars->scratch_cap = ivars->cache_cap;
             ivars->scratch
-                = (uint8_t*)REALLOCATE(ivars->scratch,
-                                       ivars->scratch_cap * sizeof(Obj*));
+                = (Obj**)REALLOCATE(ivars->scratch,
+                                    ivars->scratch_cap * sizeof(Obj*));
         }
         Sort_mergesort(ivars->cache, ivars->scratch, ivars->cache_max,
                        sizeof(Obj*), compare, self);
@@ -159,8 +159,8 @@ SortEx_Add_Run_IMP(SortExternal *self, SortExternal *run) {
         = (uint32_t*)REALLOCATE(ivars->slice_sizes,
                                 num_runs * sizeof(uint32_t));
     ivars->slice_starts
-        = (uint8_t**)REALLOCATE(ivars->slice_starts,
-                                num_runs * sizeof(uint8_t*));
+        = (Obj**)REALLOCATE(ivars->slice_starts,
+                                num_runs * sizeof(Obj*));
 }
 
 static void
@@ -223,7 +223,7 @@ static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 uint8_t *endpost) {
     uint32_t    num_runs     = VA_Get_Size(ivars->runs);
-    uint8_t   **slice_starts = ivars->slice_starts;
+    Obj       **slice_starts = ivars->slice_starts;
     uint32_t   *slice_sizes  = ivars->slice_sizes;
     VTable     *vtable       = SortEx_Get_VTable(self);
     CFISH_Sort_Compare_t compare
@@ -258,7 +258,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // Transform slice starts from ticks to pointers.
     uint32_t total = 0;
     for (uint32_t i = 0; i < ivars->num_slices; i++) {
-        slice_starts[i] = ivars->cache + total * sizeof(Obj*);
+        slice_starts[i] = (Obj*)(ivars->cache + total * sizeof(Obj*));
         total += slice_sizes[i];
     }
 
@@ -266,7 +266,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // but exploit the fact that each slice is already sorted.
     if (ivars->scratch_cap < ivars->cache_cap) {
         ivars->scratch_cap = ivars->cache_cap;
-        ivars->scratch = (uint8_t*)REALLOCATE(
+        ivars->scratch = (Obj**)REALLOCATE(
                             ivars->scratch, ivars->scratch_cap * sizeof(Obj*));
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/90cfcac8/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index a27f2c2..b1af4ad 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -53,11 +53,11 @@ abstract class Lucy::Util::SortExternal nickname 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;


Mime
View raw message