Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: memory leak from keys (issue 41) #42

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cysimdjson/cysimdjson.pyx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# cython: language_level=3

from libc.stdint cimport int64_t, uint64_t, uint32_t
from libc.stdint cimport int64_t, uint64_t
from libcpp cimport bool
from libcpp.string cimport string

from cpython.bytes cimport PyBytes_AsStringAndSize
from cpython.ref cimport PyObject

from cython.operator cimport preincrement
from cython.operator cimport dereference
Expand Down Expand Up @@ -121,7 +120,7 @@ cdef extern from "jsoninter.h":

cdef object element_to_py_string(simdjson_element & value) except + simdjson_error_handler

cdef PyObject * string_view_to_python_string(string_view & sv)
cdef object string_view_to_python_string(string_view & sv)
cdef string get_active_implementation()

cdef const char * PyUnicode_AsUTF8AndSize(object, Py_ssize_t *)
Expand Down Expand Up @@ -157,7 +156,7 @@ cdef class JSONObject:
v = it.value()

elem = JSONElement.from_element(v)
yield <object> string_view_to_python_string(sv), elem.get_value()
yield string_view_to_python_string(sv), elem.get_value()
preincrement(it)


Expand Down