Allocates a block of memory from the slice allocator
and copies block_size bytes into it from mem_block.
mem_block must be non-NULL if block_size is non-zero.
the number of bytes to allocate
the memory to copy
a pointer to the allocated memory block, which will be NULL if and
only if mem_size is 0