Commits

Victor Kotseruba committed 96a930e

multithread version

Comments (0)

Files changed (2)

   char* result = malloc(source_len);
   Py_ssize_t si = 0;
   Py_ssize_t ci = 0;
+  Py_BEGIN_ALLOW_THREADS
   for (; si < source_len; si ++, ci ++) {
     if (ci == code_len) {
       ci = 0;
     }
     result[si] = source[si] ^ code[ci];
   }
+  Py_END_ALLOW_THREADS
   PyObject* res = Py_BuildValue("s#", result, source_len);
   free(result);
   result = NULL;
 setup(
     name='cxor',
     description='fast xor',
-    version='0.1',
+    version='0.2',
     author='Viktor Kotseruba',
     author_email='barbuzaster@gmail.com',
     license='MIT',