Commit 49e4ed2b authored by Carl Friedrich Bolz-Tereick's avatar Carl Friedrich Bolz-Tereick
Browse files

gaaaaah, ByteBuffer.setslice used to use the generic implementation from

Buffer! that means a virtual method call per character read from files in pypy3
parent 280b36552fd3
......@@ -333,6 +333,12 @@ class ByteBuffer(GCBuffer):
def _get_gc_data_offset():
return get_gc_data_offset_for_list_of_chars()
def setslice(self, start, string):
# this could maybe be done with a memcopy, but at least make sure there
# is no virtual method call in the loop here!
data = self.data
for i in range(len(string)):
data[start + i] = string[i]
@GCBuffer.decorate
class StringBuffer(GCBuffer):
......
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