[fpc-devel] shm_open / shm_unlink

2006-04-09 Thread mariano podesta
hii found that shm_open and shm_unlink in smmaph.inc are mapped as externals from libc, but they belong to librt.fpc 2.0.2debian linux 2.6.14-1-k7i tested with this and worked ok:const  rt = 'rt'; function shm_open(__name: pchar; __oflag: longint; __mode: mode_t): longint; cdecl; external rt name '

Re: [fpc-devel] interface vs optimizer

2006-01-21 Thread mariano podesta
Yes. Why should the interface life longer? There isn't any owneranymore? If you need a longer life time, you need to assign the interface to something.i have many structures like this (yes, in delphi):function TXList.Lock: ILock;begin  result := TLock.Create(self);end;procedure dostuff;begin   list

Re: [fpc-devel] interface vs optimizer

2006-01-20 Thread mariano podesta
ok, but is this a correct behavior?i think it would be best to optimize with a compiler switch or to give a switch to turn it off.i have big porting problems :( ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/

[fpc-devel] interface vs optimizer

2006-01-20 Thread mariano podesta
hi people,there is a problem with functions returning interfaces:if nobody stores the result, the object decrements one reference despite turn off optimizations.sample:function getobj: IUnknown; begin  Result := TInterfacedObject.Create;end;procedure test;begin  getobj;  // here result of getobj ha

[fpc-devel] leak in destroy

2005-06-21 Thread mariano podesta
hi people, i found a memory leak when calling Destroy explicitly. the leak is in 1.9.8 and 2.0 has anyone seen this? here is an example: program mem3; {$mode objfpc}{$H+} type TTest = class (TObject, IUnknown) private FRefCount: Integer; public // IUnknown function QueryInterface(