'Returns a buffer of size shape, equivalent of calling be.empty(shape).'

def _buf_malloc(self, shape):

    if (shape not in self.buf):
        self.buf[shape] = []
    if (shape not in self.buf_active):
        self.buf_active[shape] = []
    if (len(self.buf[shape]) == 0):
        self.buf[shape].append(self.empty(shape, dtype=self.default_dtype))
    buf = self.buf[shape].pop()
    self.buf_active[shape].append(buf)
    return buf
