Simulate virtual memory using C