lib:util: Sync memory.h with replace.h