I get overly curious about esoteric technical crap, so I wrote a test case for > 4gb pointers within this scenario. Still no corruption occurs. This is ubuntu 14 w/ 64bit btw.
root@oil:/root/git/blockparty_repo/tmp# cat ./test.c
#include <stdio.h>
int main()
{
// simple int pointer
int *tmp = NULL;
// loop to alloc memory till we get > 4gb
for(;;)
{
tmp = (int *) malloc(100000000);
if(tmp > (unsigned int) -1)
break;
}
// alloc arbitrary chunk (clear alloc)
tmp = (int *) calloc(sizeof(int) * 10, 1);
// diplay the pointer
printf("\n tmp: %p - %u\n\n", tmp, tmp[0]);
// return 4byte index
return tmp[0];
}
root@oil:/root/git/blockparty_repo/tmp# gcc ./test.c
./test.c: In function \u2018main\u2019:
./test.c:12:17: warning: incompatible implicit declaration of built-in function \u2018malloc\u2019 [enabled by default]
tmp = (int *) malloc(100000000);
^
./test.c:13:10: warning: comparison between pointer and integer [enabled by default]
if(tmp > (unsigned int) -1)
^
./test.c:18:16: warning: incompatible implicit declaration of built-in function \u2018calloc\u2019 [enabled by default]
tmp = (int *) calloc(sizeof(int) * 10, 1);
^
root@oil:/root/git/blockparty_repo/tmp# valgrind ./a.out
==4704== Memcheck, a memory error detector
==4704== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==4704== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==4704== Command: ./a.out
==4704==
tmp: 0x34cf5040 - 0
==4704==
==4704== HEAP SUMMARY:
==4704== in use at exit: 4,300,000,040 bytes in 44 blocks
==4704== total heap usage: 44 allocs, 0 frees, 4,300,000,040 bytes allocated
==4704==
==4704== LEAK SUMMARY:
==4704== definitely lost: 3,700,000,040 bytes in 38 blocks
==4704== indirectly lost: 0 bytes in 0 blocks
==4704== possibly lost: 600,000,000 bytes in 6 blocks
==4704== still reachable: 0 bytes in 0 blocks
==4704== suppressed: 0 bytes in 0 blocks
==4704== Rerun with --leak-check=full to see details of leaked memory
==4704==
==4704== For counts of detected and suppressed errors, rerun with: -v
==4704== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
root@oil:/root/git/blockparty_repo/tmp#