comp.lang.ada
 help / color / mirror / Atom feed
* X'Alignment and System.Address without a "mod" operator?
@ 2015-01-05 14:49 Jacob Sparre Andersen
  2015-01-05 16:47 ` Jeffrey Carter
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Sparre Andersen @ 2015-01-05 14:49 UTC (permalink / raw)


RM 13.3(23/2) says:

   The value of this attribute is of type universal_integer, and
   nonnegative; zero means that the object is not necessarily aligned on
   a storage element boundary. If X'Alignment is not zero, then X is
   aligned on a storage unit boundary and X'Address is an integral
   multiple of X'Alignment (that is, the Address modulo the Alignment is
   zero).

But when I look for a suitable function to check the requirement in the
final parenthesis in package System (RM 13.7) - something like:

   function "mod" (Left : Address; Right : some_integer_type)
     return some_integer_type;

it isn't there.  That makes it kind of hard to implement storage pools
for types with alignment requirements.

I suppose I should report the problem to Ada-Comment, but I would prefer
that somebody could tell me that I have overlooked something.

Greetings,

Jacob
-- 
"If I have to choose between two evils, I choose the one I
 haven't tried before."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: X'Alignment and System.Address without a "mod" operator?
  2015-01-05 14:49 X'Alignment and System.Address without a "mod" operator? Jacob Sparre Andersen
@ 2015-01-05 16:47 ` Jeffrey Carter
  2015-01-05 20:07   ` Jacob Sparre Andersen
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Carter @ 2015-01-05 16:47 UTC (permalink / raw)


On 01/05/2015 07:49 AM, Jacob Sparre Andersen wrote:
> 
>    function "mod" (Left : Address; Right : some_integer_type)
>      return some_integer_type;

System.Storage_Elements (ARM 13.7.1) has

8/3
   function "mod"(Left : Address; Right : Storage_Offset)
      return Storage_Offset
         with Convention => Intrinsic;

http://www.adaic.org/resources/add_content/standards/12rm/html/RM-13-7-1.html

-- 
Jeff Carter
"Blessed is just about anyone with a vested interest in the status quo."
Monty Python's Life of Brian
73


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: X'Alignment and System.Address without a "mod" operator?
  2015-01-05 16:47 ` Jeffrey Carter
@ 2015-01-05 20:07   ` Jacob Sparre Andersen
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Sparre Andersen @ 2015-01-05 20:07 UTC (permalink / raw)


Jeffrey Carter wrote:

> System.Storage_Elements (ARM 13.7.1) has
>
> 8/3
>    function "mod"(Left : Address; Right : Storage_Offset)
>       return Storage_Offset
>          with Convention => Intrinsic;

Thanks!

I wonder why I didn't think of looking there.

Jacob
-- 
"There is nothing worse than having only one drunk head."


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-05 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05 14:49 X'Alignment and System.Address without a "mod" operator? Jacob Sparre Andersen
2015-01-05 16:47 ` Jeffrey Carter
2015-01-05 20:07   ` Jacob Sparre Andersen

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