Re: [fpc-pascal] PChars and AnsiString Code Pages

2016-05-18 Thread Jonas Maebe
Tony Whyman wrote: While the online documentation says a lot about tyepcasting PChars to AnsiStrings, there seems to be nothing on the reverse. You obviously meant the opposite. In any case, ansistring(pchar) results in the same code as ansistring:=pchar, and results in a type conversion

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 14:43 schrieb "LacaK" : >> Additionally, it's possible that it's not possible to inline generic routines in regular routines, > > It is not my case. > I use this generic in another generic and then it is specialized in interface section of same unit. > > Later this

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 15:13 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth said: > > Yes, that might indeed be the most probable cause. That's something that I > > still need to fix in trunk, cause I really want inlining to work with > > generic functions (with

Re: [fpc-pascal] PChars and AnsiString Code Pages

2016-05-18 Thread Tony Whyman
On 18/05/16 14:27, Jonas Maebe wrote: s := string(Buf); {seems to work - but should it?} end; Why shouldn't it? Because I couldn't find any documentation saying this should work and I wasn't sure if this worked by luck or design. To repeat what I said in about every message in the

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Mattias Gaertner
On Wed, 18 May 2016 14:43:06 +0200 LacaK wrote: > > > > >> Any other ideas, what leads compiler to not inline ? > > > > If you compile with -vd, the compiler will tell you in most cases why > > it's not inlining. > Hm, I have checked in Lazarus on Project Options / Verbosity

Re: [fpc-pascal] PChars and AnsiString Code Pages

2016-05-18 Thread Jonas Maebe
Tony Whyman wrote on Wed, 18 May 2016: I've been looking at some old code which still seems to work in fpc 3.0.0 - but is it safe? The code looks like: {$mode delphi} var Buf: PChar; s: string; begin Buf := LoadString; {returns a pointer to an arbitrarily long null terminated

Re: [fpc-pascal] Maximum of memory which can be used by single program in 32 bit Windows

2016-05-18 Thread Marco van de Voort
In our previous episode, LacaK said: > another question: is there any limit in FPC, which causes that only cca > 1GB of memory can be used by FPC ? No, but there is one that limits to 2GB. With {$peflags $20} in the main file that is increasable to 3GB (reportedly 4GB for 32-bits apps under

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Marco van de Voort
In our previous episode, Sven Barth said: > Yes, that might indeed be the most probable cause. That's something that I > still need to fix in trunk, cause I really want inlining to work with > generic functions (with generic records and classes it should work if the > specialization was done in

Re: [fpc-pascal] Does FPC 2.6.4 or later have an Ascii85 (Base85) implementation

2016-05-18 Thread Graeme Geldenhuys
On 2016-05-18 14:00, Graeme Geldenhuys wrote: > If FCL doesn't include an implementation (my initial search of FPC 2.6.4 > shows NO), does anybody know of an Object Pascal implementation? Scratch that, clearly my searching sucks! [case sensitivity] ;-) I found the ascii85.pp unit in fcl-base.

[fpc-pascal] Does FPC 2.6.4 or later have an Ascii85 (Base85) implementation

2016-05-18 Thread Graeme Geldenhuys
Hi, Ascii85 - also known as Base85. It works similar to Base64, but where Base64 increases the original data by 33% (four ASCII characters to represent 3 bytes of data), Base85 only increases the original data by 20% (five ASCII characters to represent 4 bytes of data).

[fpc-pascal] Maximum of memory which can be used by single program in 32 bit Windows

2016-05-18 Thread LacaK
Hi again, another question: is there any limit in FPC, which causes that only cca 1GB of memory can be used by FPC ? I have program, which reads big XML file (cca 500MB) using TXMLDocument class and attemot to expand it in memory ends with "Out of memory" exception. It is 32 bit program on 32

Re: [fpc-pascal] Inline methods

2016-05-18 Thread LacaK
Any other ideas, what leads compiler to not inline ? If you compile with -vd, the compiler will tell you in most cases why it's not inlining. Hm, I have checked in Lazarus on Project Options / Verbosity appropriate -vd option, but in output window I do not see any more info ... How

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 13:29 schrieb "Jonas Maebe" : > > > LacaK wrote on Wed, 18 May 2016: > >> Any other ideas, what leads compiler to not inline ? > > > If you compile with -vd, the compiler will tell you in most cases why it's not inlining. Additionally, it's possible that

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Jonas Maebe
LacaK wrote on Wed, 18 May 2016: Any other ideas, what leads compiler to not inline ? If you compile with -vd, the compiler will tell you in most cases why it's not inlining. Additionally, it's possible that it's not possible to inline generic routines in regular routines, because IIRC

Re: [fpc-pascal] Inline methods

2016-05-18 Thread LacaK
In my case it is not virtual method. But I forgot to mention, that it is method of generic object: generic T2DArray = object ... public constructor Init(oobMode: TOutOfBoundsMode); overload; constructor Init(x,y: integer); overload; ... function Data(x,y:

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Michael Van Canneyt
On Wed, 18 May 2016, LacaK wrote: In my case it is not virtual method. But I forgot to mention, that it is method of generic object: generic T2DArray = object ... public constructor Init(oobMode: TOutOfBoundsMode); overload; constructor Init(x,y: integer); overload;

Re: [fpc-pascal] Inline methods

2016-05-18 Thread LacaK
> > is it possible inline also methods of objects (not regular procedures) ? > > I have very simple class method, which call I need inline. > > (looking at assembler code it is not inlined; I have looked also in documentation, but I do not found article about inline and methods) > > > >

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Mark Morgan Lloyd
LacaK wrote: Hi *, is it possible inline also methods of objects (not regular procedures) ? I have very simple class method, which call I need inline. (looking at assembler code it is not inlined; I have looked also in documentation, but I do not found article about inline and methods)

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 11:07 schrieb "Sven Barth" : > > Am 18.05.2016 10:06 schrieb "LacaK" : > > > > Hi *, > > is it possible inline also methods of objects (not regular procedures) ? > > I have very simple class method, which call I need inline. > > (looking

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Sven Barth
Am 18.05.2016 10:06 schrieb "LacaK" : > > Hi *, > is it possible inline also methods of objects (not regular procedures) ? > I have very simple class method, which call I need inline. > (looking at assembler code it is not inlined; I have looked also in documentation, but I do not

[fpc-pascal] Inline methods

2016-05-18 Thread LacaK
Hi *, is it possible inline also methods of objects (not regular procedures) ? I have very simple class method, which call I need inline. (looking at assembler code it is not inlined; I have looked also in documentation, but I do not found article about inline and methods) Example: function