From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id CB2512F019 for ; Sat, 6 Jan 2001 17:48:11 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f06MmBT29577 for axp-list@listman.redhat.com; Sat, 6 Jan 2001 17:48:11 -0500 Received: from pop3.dvic.com (IDENT:root@[63.237.68.6]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f06MmBD29573 for ; Sat, 6 Jan 2001 17:48:11 -0500 Received: from voicenet.com (dialpool17190.dialpool17.voicenet.com [209.71.57.190]) by pop3.dvic.com (8.9.3/8.8.7) with ESMTP id SAA23294 for ; Sat, 6 Jan 2001 18:42:37 -0500 Message-ID: <3A57A0E6.AE3FA0FC@voicenet.com> Date: Sat, 06 Jan 2001 17:49:10 -0500 From: Uncle George X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14-6.0 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: memory address space on alpha Linux References: Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.redhat.com id f06MmBD29573 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors Looks are deceiving, the addr is a mmap() address, rather than from a traditional malloc pool. I think anything over 128k is mmapped, so that it can be unmapped without the fragmenting the malloc pool with large memory holes /gat btw by printing in hex u may see the allocation better. btw#2 malloc allocation is on a per 'C' library basis. I dont know if ccc ( true64 c compiler ) uses glibc or their own. "T. Daniel Crawford" wrote: > Hi, all, > > I'm having trouble with the way the memory allocation system works in C > as implemented under alpha Linux. Here's some simple code: > > ------------------------------------------------------------------------------ > #include > #include > > int main(void) > { > long int *n, size; > > printf("%d %d %d\n", sizeof(int), sizeof(long int), sizeof(long long > int)); > > size = 1; > n = (long int *) malloc(size * sizeof(int)); > printf("size = %d; n = %ld\n", size, n); > > size = 1000; > n = (long int *) malloc(size * sizeof(int)); > printf("size = %d; n = %ld\n", size, n); > > size = 100000; > n = (long int *) malloc(size * sizeof(int)); > printf("size = %d; n = %ld\n", size, n); > > return 0; > } > ------------------------------------------------------------------------------ > > The output from this program using the Compaq C compiler, ccc, is: > > 4 8 8 > size = 1; n = 4832890112 > size = 1000; n = 4832890608 > size = 100000; n = 2199023427600 > > Note that I get nearly the same results using GNU C. > > Now, if, instead, I run this under Compaq's Tru64 UNIX, I get: > > 4 8 8 > size = 1; n = 5368717568 > size = 1000; n = 5368721408 > size = 100000; n = 5368765536 > > For the large-block allocation, on alpha Linux the address is off in the > middle of nowhere (from my perspective) while on alpha Tru64 both the small- > and large-block allocations end up in approximately the same region of > address space. > > My questions: (1) I am misinterpreting my results? (2) If not, why does > this happen? > > Thanks in advance for any help! > > -Daniel > > -- > T. Daniel Crawford Department of Chemistry > crawdad@vt.edu Virginia Tech > www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255 > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list