summaryrefslogtreecommitdiff
path: root/src/c
Commit message (Collapse)AuthorAgeFilesLines
* Restrict ourselves to Python's Stable ABITim Burke2022-04-061-6/+7
| | | | | | | | | | | This allows us to build shared libraries that work across minor CPython releases. See also: https://docs.python.org/3/c-api/stable.html To build abi3 wheels, run something like python setup.py bdist_wheel --py-limited-api=cp35 Change-Id: Iaa747d58c6ac9dd64c5e4d3b5fdd4e56e8e2cb5e
* Clean up compile warningTim Burke2021-10-251-4/+4
| | | | | | | | | Previously, compiling would complain warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ Change-Id: Ic839ab02189103975985fc0557d6846052635b14
* Use Py_ssize_t when calling PyArg_ParseTim Burke2021-05-101-2/+3
| | | | | | | | | | | | | This has been available since Python 2.5, and our old int-based approach stopped working in Python 3.10. From https://bugs.python.org/issue36381: Raise warning for # use without PY_SSIZE_T_CLEAN. * 3.8: PendingDeprecationWarning * 3.9: DeprecationWarning * 3.10 (or 4.0): Remove PY_SSIZE_T_CLEAN and use Py_ssize_t always Change-Id: I5394268aaf4c409a75f795a44c092fd5101178cd
* Merge "Change the version reference"Jenkins2017-06-061-1/+26
|\
| * Change the version referenceKota Tsuyuzaki2017-03-011-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Now, if liberasurecode.so exposes a liberasurecode_get_version function, we'll use that; otherwise, we'll fall back to reporting the version that PyECLib was built against. Note that if your liberasurecode.so doesn't support the liberasurecode_get_verion function, pyeclib will the version at built as well as older behavior. Co-Authored-By: Tim Burke <tim.burke@gmail.com> Change-Id: I54823183cce6775a83e913baf6bb1eeb94aabc13
* | Avoid segfault when raising exceptionsTim Burke2017-05-031-81/+83
| | | | | | | | | | | | | | | | | | This came up when running the py3 unit tests after adding a test that (erroneously) tried to encode native strings. At some point, we should probably enforce tighter type-checking, but I'm not sure what all types we need (or want) to support. Change-Id: Ibb1f4f52207be83f842740d9f3c39c2a03fb1396
* | Add Phazr.IO libphazr backend supportJim Cheung2017-03-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there are several implementations of erasure codes that are available within OpenStack Swift. Most, if not all, of which are based on the Reed Solomon coding algorithm. Phazr.IO’s Erasure Coding technology uses a patented algorithm which are significantly more efficient and improves the speed of coding, decoding and reconstruction. In addition, Phazr.IO Erasure Code use a non-systematic algorithm which provides data protection at rest and in transport without the need to use encryption. Please contact support@phazr.io for more info on our technology. Change-Id: I9377fa32426a190efd0a7f0675ecf13d7e90367d
* | Merge "Use Py_BuildValue instead of manually building dicts"Jenkins2016-12-151-43/+7
|\ \
| * | Use Py_BuildValue instead of manually building dictsTim Burke2016-11-291-43/+7
| |/ | | | | | | Change-Id: I6077b1f82a910e0d939cac7eb0d05bcbcdabdeb7
* | Merge "Fix checksum memory leak"Jenkins2016-12-071-0/+1
|\ \
| * | Fix checksum memory leakTim Burke2016-12-051-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we allocate the result buffer in hex_encode_string, we're responsible for freeing it later. Why didn't we catch it before? Turns out, our tests didn't loop enough. I wasn't reliably seeing a test failure at 200k iterations, but 400k seems to be enough? Closes-Bug: #1634006 Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Related-Change: I678e10008c3c5bc04640f7f19498334d94cb0cd6 Change-Id: I0f6e922ba25ad56142f3d095896b9856a436a81c
* | ISA-L Cauchy supportKota Tsuyuzaki2016-12-011-0/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for supporting ISA-L cauchy based matrix. The difference from isa_l_rs_vand is only the matrix to use the encode/decode calculation. As a known issue, isa_l_rs_vand backend has constraint for the combinations of the available fragment to be able to decode/reconstuct. (See related change in detail) To avoid the constraint, this patch adds another isa-l backend to use cauchy matrix. The reason I try to add this intead of changing at sa_l_rs_vand, the isa_l_rs_vand backend may be already used and if we change the matrix, the current users won't be able to decode the data. To avoid the problem and keep the backward compatibility, this is in another isa_l_rs_cauchy namespace. NOTE: this depends on tag may be meaningless because the depending target is a c lang project so probably no scripts to install it we have and then, almost of the tests for isa-l will be skipped due to a lack of isa-l backend installation. Related-Change: Icee788a0931fe692fe0de31fabc4ba450e338a87 Depends-On: I6eb150d9d0c3febf233570fa7729f9f72df2e9be Change-Id: I3a5516545d17ab7ac67a9a3627c85243e2110764
* Fix formatted get_metadata memory leakTim Burke2016-11-291-55/+13
| | | | | | Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp> Change-Id: I678e10008c3c5bc04640f7f19498334d94cb0cd6
* Ref count for dict item should be Py_DECREFKota Tsuyuzaki2016-09-071-8/+54
| | | | | | | | | | | | | | | | | PyDict_SetItems doesn't steal the reference count so that the reference count of each item in the dict should be decremented via Py_DECREF *before* returning the dict to Python VM. Otherwise, those items can be leaked which can never be collected as garbage. The evicence for memory leak is avaialble for using debug mode python VM like: https://gist.github.com/bloodeagle40234/f4c0cd267e085cc6224ffdc1b1822631 Plus, this patch add one unit test to check the memory increasement for many call of get_segment_info. Closes-Bug: #1604335 Change-Id: I6780efb9718017d296606f3c7e60684910584a1a
* Correct fragment size handlingKota Tsuyuzaki2016-09-061-1/+18
| | | | | | | | | | | | | | Once we have liberasurecode older than depend-on patch, it could make an invalid mem access if the backend descripter is not available. (I'm not sure this situation happen in fact, but any other functions in liberasurecode expecting that failure actually, FWIW) To recover this failure, this patch fixes to catch the return value from liberasurecode and if it's an error code, set an error for the return value to python. Depends-On: I489f8b5d049610863b5e0b477b6ff70ead245b55 Change-Id: I47d4ec4fa1647c5a4c8d50f0aa6a2df86ca68c80
* Add tox/requirements settings to pass gate jobKota Tsuyuzaki2016-08-121-0/+9
| | | | | | | | | | Plus, we need liberasurecode version handling for a few place because some tests/engine itself is broken with a lack of backword compatibility. Closes-Bug: #1586220 Change-Id: I72adaefa10875a73e3e5304eb40fe5d9f6d2598a
* Use the check_backend_available function.Timur Alperovich2016-03-151-0/+17
| | | | | Eliminates the spurrious syslog messages and is a cleaner mechanism for querying all of the available backends on a system.
* Remove integrated liberasurecode tarballTushar Gohad2015-12-041-0/+0
| | | | | ... now that liberasurecode-dev(el) packages are available on most supported distros
* Clarifying comment about ec_desc return during initTushar Gohad2015-11-231-0/+2
| | | | | ... liberasurecode_instance_create returns an int status code - one of LIBERASURECODE_ERROR_CODES defined in erasurecode.h
* Return liberasurecode error code from pyeclib_c_initTushar Gohad2015-11-231-1/+1
| | | | ... earlier we were returning -EINVAL
* Disable error reporting during VALID_EC_TYPES evalTushar Gohad2015-11-231-14/+48
| | | | | ... this should not be required after upstream liberasurecode has more configurable logging
* Include liberasurecode_helpers.h for backward compatibilityTushar Gohad2015-11-191-0/+4
| | | | | ... for folks trying to build pyeclib with liberasurecode versions prior to 1.1.0
* Update integrated liberasurecode rev to 1.1.0Tushar Gohad2015-10-212-0/+0
|
* Use explicit path to erasurecode.hTushar Gohad2015-09-201-3/+3
|
* Implement alloc/free fns local to pyeclib c_extTushar Gohad2015-09-181-1/+45
| | | | ... stop using helpers internal to liberasurecode
* Update integrated liberasurecode rev to 1.0.9Tushar Gohad2015-09-082-0/+0
|
* Fix integer truncation issue with PyBuildValue on Big Endian systems by ↵Kevin Greenan2015-08-111-2/+2
| | | | | | | | | explicitly casting the size argument passed in to Py_ssize_t. Also fix import issue with the API test where older versions of Python fail to import.
* Adding a new tarball for the integrated installerliberasurecode_installKevin Greenan2015-07-231-0/+0
|
* Check for missing liberasurecode and install if necessaryTushar Gohad2015-07-231-0/+0
|
* Support Python int in decode() for ranges on py2Victor Stinner2015-07-211-3/+22
| | | | Before only the Python long type was accepted on Python 2.
* Expose liberasurecode error codes in PyECLibTushar Gohad2015-07-191-79/+90
| | | | | ... also move exception handing down to the C backend layer, so it is easier to add new error codes. Addresses #61.
* Plugging in new internal RS backend into pyeclibplugin_internal_rsKevin Greenan2015-05-191-0/+3
|
* Guide users to liberasurecode messages in syslog upon errorsTushar Gohad2015-03-131-0/+2
|
* Wrap calls to pyeclib_c in core.py with try/catch and wrote exampleKevin Greenan2015-03-101-1/+1
| | | | test to validate exceptions.
* Return liberasurecode errors in fixed length string buffersTushar Gohad2015-03-091-15/+25
|
* Improve pyeclib error reporting (expose liberasurecode err returns)Tushar Gohad2015-03-081-8/+41
|
* Use liberasurecode_get_fragment_sizeKota Tsuyuzaki2015-03-051-17/+6
| | | | | | | | | Currently both liberasurecode and PyECLib have fragment size calculation by dividing alignment data length. However it might cause size mismatch because of backend specific metadata added to each fragment. To prevent such a mismatch, we should use liberasurecode_get_fragment_size which allows to retrieve fragment_size from liberasurecode directly instead of calculation itself.
* This is part of Kota's pull request #17.Kevin Greenan2015-02-071-6/+6
|
* Add tests for decode metadata checks.Kevin Greenan2015-02-071-1/+1
|
* Adding support for checking fragment metadata during decode and plumbingKevin Greenan2015-02-071-1/+21
| | | | ragne parameter from python down to the C API.
* Changed the API for check_metadata to return more structured success and errorKevin Greenan2015-02-031-7/+13
| | | | information.
* Removing 'fragment_metadata_len' from the check metaadta API, as it is not ↵Kevin Greenan2015-01-191-2/+1
| | | | needed.
* Changed the return values for the check metadata API.Kevin Greenan2015-01-191-2/+3
|
* Fixing a few bugs in the original checksum formatting commit and unitKevin Greenan2015-01-191-9/+36
| | | | | | test comit. Also added a unit test for the foramtted get_metadata.
* Fix the checksum unit tests for crc32.Kevin Greenan2015-01-191-2/+15
|
* Add option to return fragment metadata as a dict, instead of an opaque buffer.Kevin Greenan2015-01-191-6/+139
|
* A few quick fixes:Kevin Greenan2014-10-231-0/+4
| | | | | 1.) Tests were not compatible with new liberasurecode API 2.) Ensure PyList was allocated
* Modified the decode function to return a list of byte arrays when ranges areKevin Greenan2014-10-231-14/+11
| | | | | | specified; otherwise, continue to return a single array of bytes. Also added a malloc check, where it was missing.
* Merged in use_backend_id (pull request #15) Tushar Gohad2014-10-221-5/+5
|\ | | | | use enumerated backend_id to reference a backend
| * use enumerated backend_id to reference a backenduse_backend_idEric Lambert2014-10-221-5/+5
| |