Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 19:33:10 +0100
From:      "Rogier R. Mulhuijzen" <drwilco@drwilco.net>
To:        Mike Silbersack <silby@silby.com>, Tom <bifrost@minions.com>
Cc:        Dimitar Peikov <mitko@rila.bg>, cjp <cjp@sandstorm.net>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Swapping performance
Message-ID:  <5.1.0.14.0.20020307193205.01c3b0f0@mail.drwilco.net>
In-Reply-To: <20020307120940.E2778-100000@patrocles.silby.com>
References:  <20020307095452.D18855-100000@frond.minions.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>Once Dimitar posts his test program, we'll be able to generate a more
>clear picture about what's really happening.  Until then, please control
>the ranting.

Am I the only one who saw that he attached it to his 1st mail?

Here you go:

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#define MALLOC_SIZE 1024*1024*256

int main(int argc, char **argv) {
   char *ptr;
   int i, i_count;
   int j;

   ptr = (char *) malloc(MALLOC_SIZE);
   bzero(ptr, MALLOC_SIZE);

   i_count = MALLOC_SIZE / 16;
   fprintf(stderr, "*");
   for (i = 0; i < i_count; i ++) {
       ptr[i >> 4] = ptr[(i >> 3) + 1]++;
   }
   fprintf(stderr, "#");
   for (j = 0; j < i_count; j ++) {
       ptr[j << 4] = ptr[(j >> 3) + 1]++;
   }

   free(ptr);
   return 0;
}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.0.20020307193205.01c3b0f0>