Commit 5eb73fa7d1665b4e189a0ab95b63399217bdb2d9

Authored by KMG
1 parent 07de6b80
Exists in master and in 1 other branch v2

Clean-up and use of aligned buffers in Test/

All of the new tests appear to pass.
Examples/.swp
No preview for this file type
Examples/cauchy_01.c 100755 → 100644
Examples/cauchy_02.c 100755 → 100644
Examples/cauchy_03.c 100755 → 100644
Examples/cauchy_04.c 100755 → 100644
Examples/decoder.c 100755 → 100644
Examples/encoder.c 100755 → 100644
Examples/jerasure_01.c 100755 → 100644
Examples/jerasure_02.c 100755 → 100644
Examples/jerasure_03.c 100755 → 100644
Examples/jerasure_04.c 100755 → 100644
Examples/jerasure_05.c 100755 → 100644
Examples/jerasure_06.c 100755 → 100644
Examples/jerasure_07.c 100755 → 100644
Examples/jerasure_08.c 100755 → 100644
Examples/liberation_01.c 100755 → 100644
Examples/makefile 100755 → 100644
... ... @@ -109,81 +109,80 @@ galois.h: ../galois.h
109 109 galois.c: ../galois.c
110 110 rm -f galois.c ; cp ../galois.c . ; chmod 0444 galois.c
111 111  
112   -galois.o ${LIBDIR}/gf_complete.a: galois.h
113 112 jerasure.o: jerasure.h galois.h
114 113  
115 114 jerasure_01.o: galois.h jerasure.h
116   -jerasure_01: jerasure_01.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
117   - $(CC) $(CFLAGS) -o jerasure_01 jerasure_01.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  115 +jerasure_01: jerasure_01.o galois.o jerasure.o
  116 + $(CC) $(CFLAGS) -o jerasure_01 jerasure_01.o jerasure.o galois.o -lgf_complete
118 117  
119 118 jerasure_02.o: galois.h jerasure.h
120   -jerasure_02: jerasure_02.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
121   - $(CC) $(CFLAGS) -o jerasure_02 jerasure_02.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  119 +jerasure_02: jerasure_02.o galois.o jerasure.o
  120 + $(CC) $(CFLAGS) -o jerasure_02 jerasure_02.o jerasure.o galois.o -lgf_complete
122 121  
123 122 jerasure_03.o: galois.h jerasure.h
124   -jerasure_03: jerasure_03.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
125   - $(CC) $(CFLAGS) -o jerasure_03 jerasure_03.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  123 +jerasure_03: jerasure_03.o galois.o jerasure.o
  124 + $(CC) $(CFLAGS) -o jerasure_03 jerasure_03.o jerasure.o galois.o -lgf_complete
126 125  
127 126 jerasure_04.o: galois.h jerasure.h
128   -jerasure_04: jerasure_04.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
129   - $(CC) $(CFLAGS) -o jerasure_04 jerasure_04.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  127 +jerasure_04: jerasure_04.o galois.o jerasure.o
  128 + $(CC) $(CFLAGS) -o jerasure_04 jerasure_04.o jerasure.o galois.o -lgf_complete
130 129  
131 130 jerasure_05.o: galois.h jerasure.h
132   -jerasure_05: jerasure_05.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
133   - $(CC) $(CFLAGS) -o jerasure_05 jerasure_05.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  131 +jerasure_05: jerasure_05.o galois.o jerasure.o
  132 + $(CC) $(CFLAGS) -o jerasure_05 jerasure_05.o jerasure.o galois.o -lgf_complete
134 133  
135 134 jerasure_06.o: galois.h jerasure.h
136   -jerasure_06: jerasure_06.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
137   - $(CC) $(CFLAGS) -o jerasure_06 jerasure_06.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  135 +jerasure_06: jerasure_06.o galois.o jerasure.o
  136 + $(CC) $(CFLAGS) -o jerasure_06 jerasure_06.o jerasure.o galois.o -lgf_complete
138 137  
139 138 jerasure_07.o: galois.h jerasure.h
140   -jerasure_07: jerasure_07.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
141   - $(CC) $(CFLAGS) -o jerasure_07 jerasure_07.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  139 +jerasure_07: jerasure_07.o galois.o jerasure.o
  140 + $(CC) $(CFLAGS) -o jerasure_07 jerasure_07.o jerasure.o galois.o -lgf_complete
142 141  
143 142 jerasure_08.o: galois.h jerasure.h
144   -jerasure_08: jerasure_08.o galois.o ${LIBDIR}/gf_complete.a jerasure.o
145   - $(CC) $(CFLAGS) -o jerasure_08 jerasure_08.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  143 +jerasure_08: jerasure_08.o galois.o jerasure.o
  144 + $(CC) $(CFLAGS) -o jerasure_08 jerasure_08.o jerasure.o galois.o -lgf_complete
146 145  
147 146 reed_sol_01.o: galois.h reed_sol.h jerasure.h
148   -reed_sol_01: reed_sol_01.o galois.o ${LIBDIR}/gf_complete.a jerasure.o reed_sol.o
149   - $(CC) $(CFLAGS) -o reed_sol_01 reed_sol_01.o reed_sol.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  147 +reed_sol_01: reed_sol_01.o galois.o jerasure.o reed_sol.o
  148 + $(CC) $(CFLAGS) -o reed_sol_01 reed_sol_01.o reed_sol.o jerasure.o galois.o -lgf_complete
150 149  
151 150 reed_sol_02.o: galois.h reed_sol.h jerasure.h
152   -reed_sol_02: reed_sol_02.o galois.o ${LIBDIR}/gf_complete.a jerasure.o reed_sol.o
153   - $(CC) $(CFLAGS) -o reed_sol_02 reed_sol_02.o reed_sol.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  151 +reed_sol_02: reed_sol_02.o galois.o jerasure.o reed_sol.o
  152 + $(CC) $(CFLAGS) -o reed_sol_02 reed_sol_02.o reed_sol.o jerasure.o galois.o -lgf_complete
154 153  
155 154 reed_sol_03.o: galois.h reed_sol.h jerasure.h
156   -reed_sol_03: reed_sol_03.o galois.o ${LIBDIR}/gf_complete.a jerasure.o reed_sol.o
157   - $(CC) $(CFLAGS) -o reed_sol_03 reed_sol_03.o reed_sol.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  155 +reed_sol_03: reed_sol_03.o galois.o jerasure.o reed_sol.o
  156 + $(CC) $(CFLAGS) -o reed_sol_03 reed_sol_03.o reed_sol.o jerasure.o galois.o -lgf_complete
158 157  
159 158 reed_sol_04.o: galois.h reed_sol.h jerasure.h
160   -reed_sol_04: reed_sol_04.o galois.o ${LIBDIR}/gf_complete.a jerasure.o reed_sol.o
161   - $(CC) $(CFLAGS) -o reed_sol_04 reed_sol_04.o reed_sol.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  159 +reed_sol_04: reed_sol_04.o galois.o jerasure.o reed_sol.o
  160 + $(CC) $(CFLAGS) -o reed_sol_04 reed_sol_04.o reed_sol.o jerasure.o galois.o -lgf_complete
162 161  
163 162 cauchy_01.o: galois.h cauchy.h jerasure.h
164   -cauchy_01: cauchy_01.o galois.o ${LIBDIR}/gf_complete.a jerasure.o cauchy.o
165   - $(CC) $(CFLAGS) -o cauchy_01 cauchy_01.o cauchy.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  163 +cauchy_01: cauchy_01.o galois.o jerasure.o cauchy.o
  164 + $(CC) $(CFLAGS) -o cauchy_01 cauchy_01.o cauchy.o jerasure.o galois.o -lgf_complete
166 165  
167 166 cauchy_02.o: galois.h cauchy.h jerasure.h
168   -cauchy_02: cauchy_02.o galois.o ${LIBDIR}/gf_complete.a jerasure.o cauchy.o
169   - $(CC) $(CFLAGS) -o cauchy_02 cauchy_02.o cauchy.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  167 +cauchy_02: cauchy_02.o galois.o jerasure.o cauchy.o
  168 + $(CC) $(CFLAGS) -o cauchy_02 cauchy_02.o cauchy.o jerasure.o galois.o -lgf_complete
170 169  
171 170 cauchy_03.o: galois.h cauchy.h jerasure.h
172   -cauchy_03: cauchy_03.o galois.o ${LIBDIR}/gf_complete.a jerasure.o cauchy.o
173   - $(CC) $(CFLAGS) -o cauchy_03 cauchy_03.o cauchy.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  171 +cauchy_03: cauchy_03.o galois.o jerasure.o cauchy.o
  172 + $(CC) $(CFLAGS) -o cauchy_03 cauchy_03.o cauchy.o jerasure.o galois.o -lgf_complete
174 173  
175 174 cauchy_04.o: galois.h cauchy.h jerasure.h
176   -cauchy_04: cauchy_04.o galois.o ${LIBDIR}/gf_complete.a jerasure.o cauchy.o
177   - $(CC) $(CFLAGS) -o cauchy_04 cauchy_04.o cauchy.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  175 +cauchy_04: cauchy_04.o galois.o jerasure.o cauchy.o
  176 + $(CC) $(CFLAGS) -o cauchy_04 cauchy_04.o cauchy.o jerasure.o galois.o -lgf_complete
178 177  
179 178 liberation_01.o: galois.h liberation.h jerasure.h
180   -liberation_01: liberation_01.o galois.o ${LIBDIR}/gf_complete.a jerasure.o liberation.o
181   - $(CC) $(CFLAGS) -o liberation_01 liberation_01.o liberation.o jerasure.o galois.o ${LIBDIR}/gf_complete.a
  179 +liberation_01: liberation_01.o galois.o jerasure.o liberation.o
  180 + $(CC) $(CFLAGS) -o liberation_01 liberation_01.o liberation.o jerasure.o galois.o -lgf_complete
182 181  
183 182 encoder.o: galois.h liberation.h jerasure.h reed_sol.h cauchy.h
184   -encoder: encoder.o galois.o ${LIBDIR}/gf_complete.a jerasure.o liberation.o reed_sol.o cauchy.o
185   - $(CC) $(CFLAGS) -o encoder encoder.o liberation.o jerasure.o galois.o ${LIBDIR}/gf_complete.a reed_sol.o cauchy.o
  183 +encoder: encoder.o galois.o jerasure.o liberation.o reed_sol.o cauchy.o
  184 + $(CC) $(CFLAGS) -o encoder encoder.o liberation.o jerasure.o galois.o reed_sol.o cauchy.o -lgf_complete
186 185  
187 186 decoder.o: galois.h liberation.h jerasure.h reed_sol.h cauchy.h
188   -decoder: decoder.o galois.o ${LIBDIR}/gf_complete.a jerasure.o liberation.o reed_sol.o cauchy.o
189   - $(CC) $(CFLAGS) -o decoder decoder.o liberation.o jerasure.o galois.o ${LIBDIR}/gf_complete.a reed_sol.o cauchy.o
  187 +decoder: decoder.o galois.o jerasure.o liberation.o reed_sol.o cauchy.o
  188 + $(CC) $(CFLAGS) -o decoder decoder.o liberation.o jerasure.o galois.o reed_sol.o cauchy.o -lgf_complete
... ...
Examples/reed_sol_01.c 100755 → 100644
Examples/reed_sol_02.c 100755 → 100644
Examples/reed_sol_03.c 100755 → 100644
Examples/reed_sol_04.c 100755 → 100644
License.txt 100755 → 100644
1 1 Copyright (c) 2011, James S. Plank
2 2 All rights reserved.
3 3  
  4 +Revision 2.0
  5 +Nov, 18 2013 (Kevin Greenan and James S. Plank)
  6 +
4 7 Redistribution and use in source and binary forms, with or without
5 8 modification, are permitted provided that the following conditions
6 9 are met:
... ...
README.nd 100755 → 100644
README.txt 100755 → 100644
Test/makefile 100755 → 100644
Test/reed_sol_test_01.c 100755 → 100644
... ... @@ -59,7 +59,18 @@ POSSIBILITY OF SUCH DAMAGE.
59 59  
60 60 #define BUFSIZE 4096
61 61  
62   -#define talloc(type, num) (type *) valloc(sizeof(type)*(num))
  62 +static void *malloc16(int size) {
  63 + void *mem = malloc(size+16+sizeof(void*));
  64 + void **ptr = (void**)((long)(mem+16+sizeof(void*)) & ~(15));
  65 + ptr[-1] = mem;
  66 + return ptr;
  67 +}
  68 +
  69 +static void free16(void *ptr) {
  70 + free(((void**)ptr)[-1]);
  71 +}
  72 +
  73 +#define talloc(type, num) (type *) malloc16(sizeof(type)*(num))
63 74  
64 75 usage(char *s)
65 76 {
... ...
Test/reed_sol_test_02.c 100755 → 100644
... ... @@ -57,7 +57,18 @@ POSSIBILITY OF SUCH DAMAGE.
57 57 #include "jerasure.h"
58 58 #include "reed_sol.h"
59 59  
60   -#define talloc(type, num) (type *) valloc(sizeof(type)*(num))
  60 +static void *malloc16(int size) {
  61 + void *mem = malloc(size+16+sizeof(void*));
  62 + void **ptr = (void**)((long)(mem+16+sizeof(void*)) & ~(15));
  63 + ptr[-1] = mem;
  64 + return ptr;
  65 +}
  66 +
  67 +static void free16(void *ptr) {
  68 + free(((void**)ptr)[-1]);
  69 +}
  70 +
  71 +#define talloc(type, num) (type *) malloc16(sizeof(type)*(num))
61 72  
62 73 void
63 74 timer_start (double *t)
... ...
cauchy.c 100755 → 100644
cauchy.h 100755 → 100644
cauchy_best_r6.c 100755 → 100644
galois.c 100755 → 100644
galois.h 100755 → 100644
jerasure.c 100755 → 100644
jerasure.h 100755 → 100644
liberation.c 100755 → 100644
liberation.h 100755 → 100644
makefile 100755 → 100644
... ... @@ -70,7 +70,7 @@ lib/libJerasure.so: lib/libJerasure.so.0
70 70  
71 71 lib/libJerasure.so.0: lib $(OBJS)
72 72 $(CC) $(LIBARGS) \
73   - -o lib/libJerasure.so.0 $(OBJS) ${LIBDIR}/gf_complete.a
  73 + -o lib/libJerasure.so.0 $(OBJS) -lgf_complete
74 74  
75 75 install: lib/libJerasure.so
76 76 cp -P lib/libJerasure.so* ${LIBDIR}
... ...
reed_sol.c 100755 → 100644
reed_sol.h 100755 → 100644