* What is more efficient: a container or a manual programming?
@ 2014-08-09 17:42 Victor Porton
2014-08-09 18:03 ` Victor Porton
0 siblings, 1 reply; 3+ messages in thread
From: Victor Porton @ 2014-08-09 17:42 UTC (permalink / raw)
What is more efficient: Rec or Cont?
type Rec new Limited_Controlled with
record
Str: access String;
end record;
--
-- Code to automatically deallocate Str when Rec is finalized
--
or
type Cont is new (String);
(Note: in the real code it may be Interfaces.C.char_array instead of
String.)
--
Victor Porton - http://portonvictor.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: What is more efficient: a container or a manual programming?
2014-08-09 17:42 What is more efficient: a container or a manual programming? Victor Porton
@ 2014-08-09 18:03 ` Victor Porton
2014-08-09 19:46 ` Jeffrey Carter
0 siblings, 1 reply; 3+ messages in thread
From: Victor Porton @ 2014-08-09 18:03 UTC (permalink / raw)
Victor Porton wrote:
> What is more efficient: Rec or Cont?
>
> type Rec new Limited_Controlled with
> record
> Str: access String;
> end record;
>
> --
> -- Code to automatically deallocate Str when Rec is finalized
> --
>
> or
>
> type Cont is new (String);
>
> (Note: in the real code it may be Interfaces.C.char_array instead of
> String.)
Should be instead:
type Cont is new Containers.Indefinite_Holders(String);
--
Victor Porton - http://portonvictor.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: What is more efficient: a container or a manual programming?
2014-08-09 18:03 ` Victor Porton
@ 2014-08-09 19:46 ` Jeffrey Carter
0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey Carter @ 2014-08-09 19:46 UTC (permalink / raw)
On 08/09/2014 11:03 AM, Victor Porton wrote:
>
>> What is more efficient: Rec or Cont?
>>
>> type Rec new Limited_Controlled with
>> record
>> Str: access String;
>> end record;
>>
>> --
>> -- Code to automatically deallocate Str when Rec is finalized
>> --
>>
>> or
>
> type Cont is new Containers.Indefinite_Holders(String);
Cont, because it makes more efficient use of the developer(s). Anything else is
only an issue if using Cont is preventing the system from meeting its timing
requirements.
--
Jeff Carter
"I fart in your general direction."
Monty Python & the Holy Grail
05
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-09 19:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-09 17:42 What is more efficient: a container or a manual programming? Victor Porton
2014-08-09 18:03 ` Victor Porton
2014-08-09 19:46 ` Jeffrey Carter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox