cas for alloc buffer