def __init__(self,sz,itemsz=1): "sz is byte count" self.a=sonic.array_new(sz) self.sz=sonic.array_sz(self.a) # bytecount self.mem=sonic.array_mem(self.a) self.itemsz=itemsz # used for indexing log(self)
def __init__(self,array,start,end): self.a=sonic.array_new_sub(array.a,start,end) self.mem=sonic.array_mem(self.a) self.sz=sonic.array_sz(self.a)
def __init__(self,filename): self.filename=filename self.a=sonic.array_new_mmap(filename) self.sz=sonic.array_sz(self.a) self.mem=sonic.array_mem(self.a)