예제 #1
0
파일: main.py 프로젝트: forrestv/pyable
 def _grow(self):
     new_allocated = self._allocated * 2 + 1
     new_store = __pyable__.raw(4 * new_allocated)
     if self._used:
         new_store.copy_from(self._store, 4 * self._used)
     self._allocated = new_allocated
     self._store = new_store
예제 #2
0
파일: main.py 프로젝트: forrestv/pyable
 def _grow(self):
     new_allocated = self._allocated * 2 + 1
     new_store = __pyable__.raw(4 * new_allocated)
     if self._used:
         new_store.copy_from(self._store, 4 * self._used)
     self._allocated = new_allocated
     self._store = new_store
예제 #3
0
파일: main.py 프로젝트: forrestv/pyable
    def _grow(self):
        new_table = []
        for i in xrange(len(self._table) * 2):
            new_table.append([])

        new_allocated = self._allocated * 2 + 1
        new_store = __pyable__.raw(4 * new_allocated)
        if self._used:
            new_store.copy_from(self._store, 4 * self._used)
        self._allocated = new_allocated
        self._store = new_store
예제 #4
0
파일: main.py 프로젝트: forrestv/pyable
 def _grow(self):
     new_table = []
     for i in xrange(len(self._table) * 2):
         new_table.append([])
     
     new_allocated = self._allocated * 2 + 1
     new_store = __pyable__.raw(4 * new_allocated)
     if self._used:
         new_store.copy_from(self._store, 4 * self._used)
     self._allocated = new_allocated
     self._store = new_store
예제 #5
0
파일: rawstore.py 프로젝트: forrestv/pyable
import __pyable__

t1 = __pyable__.raw(100)
t2 = __pyable__.raw(200)

t1[50] = 4141
t2[100] = 50
t2[50] = 42

print t1[50]

print t2[100]


t1[0] = 42
t1.store_object(1, t2)

print

print t1[0]
#print t1[1]
#print t1[2]

t2.store_object(20, 43)

print t1.load_object(1).load_object(20)
예제 #6
0
import __pyable__

t1 = __pyable__.raw(100)
t2 = __pyable__.raw(200)

t1[50] = 4141
t2[100] = 50
t2[50] = 42

print t1[50]

print t2[100]

t1[0] = 42
t1.store_object(1, t2)

print

print t1[0]
#print t1[1]
#print t1[2]

t2.store_object(20, 43)

print t1.load_object(1).load_object(20)