comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: avoiding builtin memset
Date: Mon, 24 Apr 2017 18:21:21 -0700 (PDT)
Date: 2017-04-24T18:21:21-07:00	[thread overview]
Message-ID: <c76b2227-105a-4ceb-93e1-5f7a14788574@googlegroups.com> (raw)
In-Reply-To: <934912c8-c189-4d36-8a96-b2aa97e38685@googlegroups.com>

On Monday, April 24, 2017 at 9:56:51 AM UTC-7, Shark8 wrote:
> I suppose you could try this:
> 
>     Procedure Memset(
>        Address : System.Address;
>        Value   : System.Storage_Elements.Storage_Element;
>        Length  : Natural
>       ) is
> 	Use System.Storage_Elements;
> 	Memory : Storage_Array(1..Storage_Offset(Length))
> 	  with Import, Address => Address;
>     Begin
> 	For Element of Memory loop
> 	    Element := Value;
> 	end loop;
>     End Memset;

It is very nice. Indeed, it is compact and readable piece of code.

Anh Vo

  reply	other threads:[~2017-04-25  1:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 16:06 avoiding builtin memset Jere
2017-04-24 16:56 ` Shark8
2017-04-25  1:21   ` Anh Vo [this message]
2017-04-25  2:57     ` Luke A. Guest
2017-04-25 18:43       ` Shark8
2017-04-25 22:18         ` Luke A. Guest
2017-04-26  7:35           ` Simon Wright
2017-04-26 13:44             ` Lucretia
2017-04-26 15:22               ` Simon Wright
2017-04-27  0:22   ` Jere
2017-04-27  4:35     ` J-P. Rosen
2017-04-27  7:09       ` Simon Wright
2017-05-24 15:08 ` Frédéric PRACA
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox