mirror of
https://github.com/minio/minio.git
synced 2025-04-23 03:45:49 -04:00
Merge pull request #68 from harshavardhana/pr_out_avoid_clang_optimization_keep_it_o0
This commit is contained in:
commit
7005d979bd
@ -46,6 +46,10 @@ int32_t minio_get_source_target (int errs, int k, int m,
|
|||||||
uint8_t *tmp_source[k];
|
uint8_t *tmp_source[k];
|
||||||
uint8_t *tmp_target[m];
|
uint8_t *tmp_target[m];
|
||||||
|
|
||||||
|
if (k < 0 || m < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
memset (tmp_source, 0, k);
|
memset (tmp_source, 0, k);
|
||||||
memset (tmp_target, 0, m);
|
memset (tmp_target, 0, m);
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package erasure
|
package erasure
|
||||||
|
|
||||||
// #cgo CPPFLAGS: -Iisal/include
|
// #cgo CPPFLAGS: -Iisal/include
|
||||||
|
// #cgo CFLAGS: -O0
|
||||||
// #include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
// #include <erasure-code.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]))
|
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)
|
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,
|
C.ec_encode_data(C.int(chunk_size), e.k, C.int(err_count-1), decode_tbls,
|
||||||
source, target)
|
source, target)
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ package erasure
|
|||||||
|
|
||||||
// #cgo CPPFLAGS: -Iisal/include
|
// #cgo CPPFLAGS: -Iisal/include
|
||||||
// #cgo LDFLAGS: isal/isa-l.a
|
// #cgo LDFLAGS: isal/isa-l.a
|
||||||
|
// #cgo CFLAGS: -O0
|
||||||
// #include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
// #include <erasure-code.h>
|
// #include <erasure-code.h>
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user