comp.lang.ada
 help / color / mirror / Atom feed
* access-to-classwide has non-static size?
@ 2015-03-27  8:26 Simon Wright
  2015-03-27  8:46 ` J-P. Rosen
  2015-03-27  8:49 ` Simon Wright
  0 siblings, 2 replies; 12+ messages in thread
From: Simon Wright @ 2015-03-27  8:26 UTC (permalink / raw)


I'm creating a PO which has a member which is a bounded vector of
pointer-to-classwide,

   type Event_Base is abstract tagged limited private;
   type Event_P is access all Event_Base'Class;

...

   package Event_Queues is new Ada.Containers.Bounded_Vectors
     (Index_Type   => Positive,
      Element_Type => Event_P);

...

   protected type Dispatchable_Events is
      ...
   private
      ...
      The_Events : Event_Queues.Vector (Capacity => Capacity);

and when compiling with the Ravenscar profile (GNAT GPL 2014, GCC 4.9.1,
GCC 5.0.0 20150208) the compiler says

   warning: component has non-static size
   warning: creation of protected object of type "Dispatchable_Events"
    will violate restriction No_Implicit_Heap_Allocations

Is this (the non-static size part!) right?

I tried declaring Event_P "with Size => 64"; no difference.

I think, studying the output of -gnatR, a pointer-to-classwide is a thin
pointer, i.e. 4 bytes on arm-eabi).


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

end of thread, other threads:[~2015-03-27 21:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27  8:26 access-to-classwide has non-static size? Simon Wright
2015-03-27  8:46 ` J-P. Rosen
2015-03-27  8:53   ` Simon Wright
2015-03-27  9:13     ` J-P. Rosen
2015-03-27 14:18       ` Simon Wright
2015-03-27 14:58         ` J-P. Rosen
2015-03-27 15:08           ` Egil H H
2015-03-27 16:51             ` J-P. Rosen
2015-03-27 15:51         ` sbelmont700
2015-03-27 21:11           ` Simon Wright
2015-03-27  8:49 ` Simon Wright
2015-03-27  8:53   ` Simon Wright

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