Created
September 19, 2017 11:38
-
-
Save njlr/d78339cb588f84ff5141e192389890ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char memorypool[64]; | |
int* a = new (memorypool) int[4]; | |
int* b = new (memorypool + sizeof(int) * 4) int[4]; | |
assert( (void*)a[0] == (void*)memorypool[0] ); | |
assert( (void*)b[0] == (void*)memorypool[32] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment