comp.lang.ada
 help / color / mirror / Atom feed
From: Luke A. Guest <laguest@archeia.com>
Subject: Re: avoiding builtin memset
Date: Tue, 25 Apr 2017 03:57:08 +0100
Date: 2017-04-25T03:57:08+01:00	[thread overview]
Message-ID: <987550450.514781782.903623.laguest-archeia.com@nntp.aioe.org> (raw)
In-Reply-To: c76b2227-105a-4ceb-93e1-5f7a14788574@googlegroups.com

Anh Vo <anhvofrcaus@gmail.com> wrote:
> 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
> 

You'll need to export that as the C memset function.


  reply	other threads:[~2017-04-25  2:57 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
2017-04-25  2:57     ` Luke A. Guest [this message]
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