Add setMemoryProvider and getMemoryProvider.

Signed-off-by: crynobone <crynobone@gmail.com>