comparison gcc/ada/libgnat/memtrack.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- S Y S T E M . M E M O R Y -- 5 -- S Y S T E M . M E M O R Y --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 2001-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 2001-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
102 pragma Import (C, OS_Exit, "__gnat_os_exit"); 102 pragma Import (C, OS_Exit, "__gnat_os_exit");
103 pragma No_Return (OS_Exit); 103 pragma No_Return (OS_Exit);
104 104
105 procedure fwrite 105 procedure fwrite
106 (Ptr : System.Address; 106 (Ptr : System.Address;
107 Size : size_t;
108 Nmemb : size_t;
109 Stream : File_Ptr);
110
111 procedure fwrite
112 (Str : String;
113 Size : size_t; 107 Size : size_t;
114 Nmemb : size_t; 108 Nmemb : size_t;
115 Stream : File_Ptr); 109 Stream : File_Ptr);
116 pragma Import (C, fwrite); 110 pragma Import (C, fwrite);
117 111
304 if Gmemfile = System.Null_Address then 298 if Gmemfile = System.Null_Address then
305 Put_Line ("Couldn't open gnatmem log file for writing"); 299 Put_Line ("Couldn't open gnatmem log file for writing");
306 OS_Exit (255); 300 OS_Exit (255);
307 end if; 301 end if;
308 302
309 fwrite ("GMEM DUMP" & ASCII.LF, 10, 1, Gmemfile); 303 declare
310 fwrite (Timestamp'Address, Duration'Max_Size_In_Storage_Elements, 1, 304 S : constant String := "GMEM DUMP" & ASCII.LF;
311 Gmemfile); 305 begin
306 fwrite (S'Address, S'Length, 1, Gmemfile);
307 fwrite (Timestamp'Address, Duration'Max_Size_In_Storage_Elements,
308 1, Gmemfile);
309 end;
312 end if; 310 end if;
313 end Gmem_Initialize; 311 end Gmem_Initialize;
314 312
315 ------------- 313 -------------
316 -- Realloc -- 314 -- Realloc --