mirror of https://github.com/kivy/kivy.git
buffer: fix void return to grow + add clear() method
This commit is contained in:
parent
0f5f408f2b
commit
486a0be44d
|
@ -5,7 +5,8 @@ cdef class Buffer:
|
|||
cdef int block_count
|
||||
cdef int need_pack
|
||||
|
||||
cdef grow(self, int block_count)
|
||||
cdef void clear(self)
|
||||
cdef void grow(self, int block_count)
|
||||
cdef void add(self, void *blocks, int *indices, int count)
|
||||
cdef void remove(self, int *indices, int count)
|
||||
cdef void pack(self)
|
||||
|
@ -14,4 +15,4 @@ cdef class Buffer:
|
|||
cdef void *pointer(self)
|
||||
cdef void *offset_pointer(self, int offset)
|
||||
cdef void update(self, int index, void* blocks, int count)
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ cdef class Buffer:
|
|||
self.block_size = block_size
|
||||
|
||||
|
||||
cdef grow(self, int block_count):
|
||||
cdef void grow(self, int block_count):
|
||||
'''Automaticly realloc the memory if they are no enough block.
|
||||
Work only for "grow" operation, not the inverse.
|
||||
'''
|
||||
|
@ -54,6 +54,12 @@ cdef class Buffer:
|
|||
self.block_count = block_count
|
||||
|
||||
|
||||
cdef void clear(self):
|
||||
'''Clear the whole buffer, and mark all blocks as available.
|
||||
'''
|
||||
self.l_free = range(self.block_count)
|
||||
|
||||
|
||||
cdef void add(self, void *blocks, int *indices, int count):
|
||||
'''Add a list of block inside our buffer
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue