well I found it
the code should be
with ada.text_io, Interfaces.C_Streams;
procedure memfault is
type bufarr is new string(1..bsize);
type buf is access all bufarr;
I abandoned Ada last year after learning it, exactly for the reason that you cannot get around the C-libraries, and need to work with the translations between type names in interfaces.C. Well, no choice.
The above is just as fast as the c++code below. My input files are utf-8, but the seperator tokens are all ascii, so this does not pose a problem.
My guess is that gcc compiles it to about the same thing as
#define BSIZE 28000000
using namespace std;
char * strbuf= new char [BSIZE+1];
cout << strbuf<<endl;
cout << "done"<< endl;