Commit 2deb1958 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Convert all of our file methods to the CPython implementations

There's some low-hanging optimization fruit in here if we want to
(unnecessary crossings between Pyston and CAPI environments)
but we'll see.
parent 6bba2b53
...@@ -79,6 +79,10 @@ Box* BoxedWrapperDescriptor::__get__(BoxedWrapperDescriptor* self, Box* inst, Bo ...@@ -79,6 +79,10 @@ Box* BoxedWrapperDescriptor::__get__(BoxedWrapperDescriptor* self, Box* inst, Bo
return new BoxedWrapperObject(self, inst); return new BoxedWrapperObject(self, inst);
} }
extern "C" int PyObject_AsCharBuffer(PyObject* obj, const char** buffer, Py_ssize_t* buffer_len) noexcept {
Py_FatalError("unimplemented");
}
// copied from CPython's getargs.c: // copied from CPython's getargs.c:
extern "C" int PyBuffer_FillInfo(Py_buffer* view, PyObject* obj, void* buf, Py_ssize_t len, int readonly, extern "C" int PyBuffer_FillInfo(Py_buffer* view, PyObject* obj, void* buf, Py_ssize_t len, int readonly,
int flags) noexcept { int flags) noexcept {
......
This diff is collapsed.
...@@ -3,16 +3,20 @@ import time ...@@ -3,16 +3,20 @@ import time
print type(allocate_lock()) print type(allocate_lock())
print_lock = allocate_lock()
done = 0 done = 0
def run(arg): def run(arg):
global done global done
print "in other thread!", arg with print_lock:
print "in other thread!", arg
done = 1 done = 1
print "starting!" print "starting!"
t = start_new_thread(run, (5,)) with print_lock:
print type(t) t = start_new_thread(run, (5,))
print type(t)
while not done: while not done:
time.sleep(0) time.sleep(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment