[feature] memory alloc function