From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fb8bad9f41ba1413 X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: Pragma inline results in duplicate strings? Date: 1997/06/04 Message-ID: #1/1 X-Deja-AN: 246037616 Sender: sam@zaphod.enst.fr References: <5n2ohf$htn$1@goanna.cs.rmit.edu.au> To: Dale Stanbrough Organization: Sam's machine Newsgroups: comp.lang.ada Date: 1997-06-04T00:00:00+00:00 List-Id: >>>>> "Dale" == Dale Stanbrough writes: Dale> Is the string duplicated for each inline call? Not with GNAT. See the following piece of code: with Ada.Text_IO; use Ada.Text_IO; procedure T is procedure Break; pragma Inline (Break); procedure Break is begin Put_Line ("
"); end Break; begin Break; Break; end T; It generates the following on a i386 with GNAT: .file "t.adb" .version "01.01" gcc2_compiled.: .section .rodata .LC0: .string "
" .align 4 .LC1: .long 1 .long 4 (the .text section has been omitted) So it appears that GNAT is sharing strings literal, at least for several instances of the same string in the same package. I haven't tested how it behaves with external calls to Break. Sam -- Samuel Tardieu -- sam@ada.eu.org