www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/19/05:21:25

Date: Wed, 19 Apr 1995 09:14:02 +0200
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: pietervk AT vub DOT vub DOT ac DOT be (Pieter Vankeerberghen)
Subject: Performance of addressing memory


Dear,



To improve error checking, I followed the suggestion to put "guard bytes"
around a malloced block and to check when the block is freed, whether
these guards have been overwritten. 

The problem is that when I use one char before and one char 
after e.g. an array of doubles, the time of *addressing* the array 
is significantly (but not very large) larger than when I use 
an int as guard. When I use a calloced array there is no 
difference with ints as guards. Not that I do not count the time 
needed to allocate the blocks.


More in detail:

begin
        Allocate a block

        t1 = clock
        do simulation ( use Lehmer random generator, 
                        fill array and find median)
        t2 = clock
        free block
end



What might make the difference ?

By the way, I use the clock function (resolution 1/18 the second)
since the PCTIMER.ZIP library does not work on a Compag LTE 486. 
But I remember that it worked on a Intel 486DX2 clone. 

Perhaps I did something wrong ? Recommendations ?



Kind regards,


Pieter Vankeerberghen
-----------------------------------------------------------------------------
Pieter Vankeerberghen                       tel: +00 32 2 477 43 29
Fabi/ChemoAc                                fax: +00 32 2 477 47 35
Vrije Universiteit Brussel                  email: pietervk AT vub DOT vub DOT ac DOT be
Laarbeeklaan 103
1090 Brussels
Belgium
-----------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019