fix mremap memory synchronization and use of variadic argument