This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Speeding up ggc-simple on stage1
On Sat, Jan 15, 2000 at 11:00:50PM -0200, Alexandre Oliva wrote:
> But attacking the hot spots is precisely what I'm doing. ggc-simple
> seems to be just too slow.
I've just remembered something. This is AIX 4.1 you're
working on right? It has mmap. What it doesn't do is
pass the normal can-we-force-map-anywhere default test
that autoconf uses.
I'm thinking a test like this would be more useful for us.
Comments?
r~
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
void *x;
int fd, pg;
fd = open("/dev/zero", O_RDWR);
if (fd < 0)
return 1;
pg = getpagesize();
x = mmap(0, pg, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
if (x == (void *) -1)
return 2;
*(int *)x += 1;
if (munmap(x, pg) < 0)
return 3;
return 0;
}