Merge pull request #68 from harshavardhana/pr_out_avoid_clang_optimization_keep_it_o0

master
Harshavardhana 10 years ago
commit 7005d979bd
  1. 4
      pkg/storage/erasure/decode.c
  2. 7
      pkg/storage/erasure/decode.go
  3. 1
      pkg/storage/erasure/encode.go

@ -46,6 +46,10 @@ int32_t minio_get_source_target (int errs, int k, int m,
uint8_t *tmp_source[k];
uint8_t *tmp_target[m];
if (k < 0 || m < 0) {
return -1;
}
memset (tmp_source, 0, k);
memset (tmp_target, 0, m);

@ -19,6 +19,7 @@
package erasure
// #cgo CPPFLAGS: -Iisal/include
// #cgo CFLAGS: -O0
// #include <stdlib.h>
// #include <erasure-code.h>
//
@ -81,9 +82,13 @@ func (e *Encoder) Decode(chunks [][]byte, length int) ([]byte, error) {
data := (**C.uint8_t)(unsafe.Pointer(&pointers[0]))
C.minio_get_source_target(C.int(err_count-1), e.k, e.m, error_index_ptr,
ret := C.minio_get_source_target(C.int(err_count-1), e.k, e.m, error_index_ptr,
decode_index, data, &source, &target)
if int(ret) == -1 {
return nil, errors.New("Decoding source target failed")
}
C.ec_encode_data(C.int(chunk_size), e.k, C.int(err_count-1), decode_tbls,
source, target)

@ -20,6 +20,7 @@ package erasure
// #cgo CPPFLAGS: -Iisal/include
// #cgo LDFLAGS: isal/isa-l.a
// #cgo CFLAGS: -O0
// #include <stdlib.h>
// #include <erasure-code.h>
//

Loading…
Cancel
Save