www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/21/02:59:26

Date: Wed, 21 Oct 1998 08:57:35 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Ludvig Larsson <ludvig AT club-internet DOT fr>
cc: djgpp AT delorie DOT com
Subject: Re: superslow simpel rep stosl, why?
In-Reply-To: <362D2BD1.28EA@club-internet.fr>
Message-ID: <Pine.SUN.3.91.981021085344.22991G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Wed, 21 Oct 1998, Ludvig Larsson wrote:

> the memory chunk to clear is just allocated with malloc().

malloc returns aligned memory, but do you clear the buffer starting 
at the beginning of what malloc returned?

For example, the following snippet will get tremendously slowed-down by 
unaligned accesses:

	unsigned char *buf = (unsigned char *) malloc (buf_size);
	clear_buf (buf + 1, buf_size - 1);

(where clear_buf stands for your inline assembly stuff).

- Raw text -


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