I lost in Code ... lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-05-23 17:12 Hello, I have the following Code that concerns me: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TExitProcedure = procedure;const  MaxExitProcs = 64;var  ExitProcedure: array[0..MaxExitProcs - 1] of TExitProcedure;  ExitProcedureCount: Integer; procedure AddExitProc(P: TExitProcedure); stdcall; export;begin  if ExitProcedureCount < MaxExitProcs then  begin    ExitProcedure[ExitProcedureCount] := P;    writeln('add: ' + inttostr32(ExitProcedureCount));    ExitProcedureCount := ExitProcedureCount + 1;  end else  begin    writeln('too many exit procedures.');    Halt(1);  end;end; procedure fpc_do_exit; [public, alias: 'FPC_DO_EXIT'];var  p: TExitProcedure;  tempi: Integer;begin  fpc_finalizeunits;    tempi := ExitProcedureCount;  repeat    writeln('tempi: ' + IntTostr32(tempi));    p := TExitProcedure(ExitProcedure[tempi]);    if p <> nil then    begin    writeln('call: ' + IntToStr(tempi));      p;      tempi := tempi - 1;    end;  until tempi = 0;    ExitProcess(ExitCode);end;  But I get: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Reading symbols from test.exe...(gdb) rStarting program: T:\a\test.exe[New Thread 20372.0x5b5c][New Thread 20372.0x5a38][New Thread 20372.0x567c]DLL attach: okstartadd: 0add: 1tempi: 0[Thread 20372.0x567c exited with code 0][Thread 20372.0x5a38 exited with code 0][Thread 20372.0x5b5c exited with code 0][Inferior 1 (process 20372) exited normally] Take a look to "tempi"... ---------------------------------------------------------------------- d2010 · 2025-05-23 17:25 Quote from: paule32 on May 23, 2025, 07:12:52 pmHello, I have the following Code that concerns me: I do not understand ,your wish. I break my application to many tines unit/s even are more empty, My hint is = You can add halt or exitproc at any unit.pp, without ExitProc redirect. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i InitializationBegin      ValueName[0]:=#0;      ValueName[1]:=#0;    ValueName[2]:=#0;End; FinalizationBegin     halt;End;                  End.  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Unit hc_tram48;InterfaceUses hc_type48;Var rezultat:string='';    lsp2c_prep:record               argc:word;               argv:array [Word] of hc_type48.NavTree;            end;Function hctram_boot:Integer;Function vla_getvar_treemax:integer;Implementation Function hctram_Boot:Integer;Begin  result:=sizeof(NodeType);       fillchar(lsp2c_prep,sizeof(lsp2c_prep),0);       fillchar(lsp2c_prep,sizeof(lsp2c_prep),Byte(0));       with jcs_multianewarray0tx8  do fillTtf:='';End;{--}Function vla_getvar_treemax:integer;Var iterator:integer;Begin result:=0;      for iterator:=0 to lsp2c_prep.argc do         result:=result+sizeof(ls p2c_prep.argv[iterator]);End;{--}Initialization  hctram_Boot();FinalizationEnd. ---------------------------------------------------------------------- paule32 · 2025-05-23 17:46 you don't understand my concerns: - in Line 15, I do a increment of ExitProcedureCount - in Line 30, I set tempi with ExitProcedureCount   and here, tempi is zero, instead one: 1 - I had tried to play with the Optimized Options like -O1 -O2 ... but all give me the same result ---------------------------------------------------------------------- ASerge · 2025-05-23 20:57 Quote from: paule32 on May 23, 2025, 07:12:52 pmTake a look to "tempi"... In this code, you never call AddExitProc, so ExitProcedureCount is always zero, as a result, the tempi variable is also zero. ---------------------------------------------------------------------- paule32 · 2025-05-24 06:11 sorry for confuse you. the code looks like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure CleanUp1;begin  WriteLn('cleanup1 called.');end; procedure CleanUp2;begin  WriteLn('cleanup2 called.');end; begin  writeln('start');    AddExitProc(@CleanUp1);  AddExitProc(@CleanUp2);    Halt(2);end; (see Line 14 of prior post) ---------------------------------------------------------------------- paule32 · 2025-05-24 07:39 hui... what a mess... I solved the Problem by using getter Function. ---------------------------------------------------------------------- Martin_fr · 2025-05-24 08:05 No idea what is the cause. But, an idea how to debug. - Start the App. - hit a breakpoint (when you first add an exit proc, or before). - Set a Watchpoint (data breakpoint) on: ExitProcedureCount  (monitor for "write" access, or "both")   (must be in scope, but as a global var it should be...) - Run Now it will always stop, when the variable changes (or even if it is read). So it should stop when you increment it. And if it gets reset to 0 (by any means whatsoever) then it breaks too. As long as it is all using the same var, it should tell you where it is set to zero. ---------------------------------------------------------------------- paule32 · 2025-05-24 10:07 Thank you for the step by step guide. I don't familar with all the details of Windows... but for me it could be clear now: I have double Code: - 1 times for export's (DLL code outsource), and - 1 times for import's and normal EXE code where the second manner is a stub like code that call the exports in the DLL. Then I thinking, I have two processes: - 1 times the EXE, and - 1 times the DLL So I thinking next that I access with the EXE the right Functions, but by using the Functions, the DLL global vars will be override by the EXE one (because it is the Idea of DLL that many EXE can access one DLL - and when a second Process access the global DLL Code, it will be override). So, I was thinking to get a Function get, that get the Process attached Variable, and get done with that. It seems that some details of DLL and EXE becomes in one Process, so you (me) can use a common space together - like you access a new Instance of an Object - you will get a new Pointer - and with this Pointer, you (me) can bind other (global ?) Pointers. Some wired to explain for me, but it works, now. ---------------------------------------------------------------------- cdbc · 2025-05-24 11:00 Hi A dll gets loaded into the process' space, BUT you have to make sure, that they SHARE the SAME MEMORY-MANAGER. Otherwise, you're stuck with pure C-API & boundries. Regards Benny ---------------------------------------------------------------------- H₂SO₄ · 2025-05-26 05:56 Quote from: paule32 on May 24, 2025, 12:07:39 pmSo I thinking next that I access with the EXE the right Functions, but by using the Functions, the DLL global vars will be override by the EXE one (because it is the Idea of DLL that many EXE can access one DLL - and when a second Process access the global DLL Code, it will be override). Using DLLs many different processes can load the same shared code - but DLLs by themselves can not used to share data between processes. Think of a DLL as an actual, physical library with books - many people may borrow some books and memorize the contents, but they aren't allowed to just scribble stuff onto the pages - that would make the librarian very unhappy  DLLs can't live on their own, they need a host (kind of like a parasite  ) that loads them into their address space. There is no system-wide global instance of any given DLL, but there may exist many copies spread across (and living inside) many different processes. With that being said, I'm intrigued by your project with @Fibonacci. Are you trying to reimplement the RTL? ---------------------------------------------------------------------- paule32 · 2025-05-26 16:30 yes, I am on the way to reimplement the RTL on a way of using DLL Files. This comes in many conversions from the past... But I thinking on a light weight system, where the executables have a minimal size, by using DLL. The actual DLL File has a size of 43 KB (with pre alpha classes for Forms) and the EXE File Demo comes with 14 KB - unpacked. If you use UPX, then you can reach the half of the size on storages. ---------------------------------------------------------------------- Fibonacci · 2025-05-26 20:47 Quote from: Khrys on May 26, 2025, 07:56:59 amWith that being said, I'm intrigued by your project with @Fibonacci. Are you trying to reimplement the RTL? I must say, again, that Im not a fan of this idea - RTL in a DLL. Im just watching. I already explained to Paule, that if there is a DLL, it needs to export everything, always, while a single exe pulls in only the code it actually uses, becoming significantly smaller, and that is the goal. Also, shipping two files instead of one is just another hassle. ---------------------------------------------------------------------- Thaddy · 2025-05-27 04:46 One big single dll is indeed not a good idea, but with on demand dynamic loading it can be distributed over several dll's. This is what the Windows OS does. Other  option is to wait until the DCU style packaging is finished. For simple and small code, we already have KOL, which has its own rtl and optionally its own system. Which gives you GUI applications from 14 (Delphi) or 40-50 KB (FreePascal) Paule should study how KOL handles its system. (But note KOL uses old school objects, not classes and does not well mix with classes, because then the size comes back to standard. On  non-OOP it is almost fully compatible, though) KOL 3.2.3 is available for FPC, but I did not check beyond FPC 3.0.0 for lack of time and basically I would probavly have to finally finish KOL 4.0 and FPC 3.2.2 and Trunk/Main. An advantage is that KOL is already 32 and 64 bit Windows. Paule only writes 32 bit code. ---------------------------------------------------------------------- 440bx · 2025-05-27 05:28 I think that putting the entire FPC RTL in a dll is a good idea.  Making it usable by any program might not be simple if the compiler insists on always including the RTL in the executable. Having the RTL in a dll might even solve some problems in addition to sharing more code and making executables smaller. All that said, I'm not fond of using UPX. ETA: it's rather unlikely that the entire RTL can be put in a dll given that functions like writeln cannot be accurately described as an export. ---------------------------------------------------------------------- Thaddy · 2025-05-27 06:46 Quote from: 440bx on May 27, 2025, 07:28:41 amI think that putting the entire FPC RTL in a dll is a good idea.  Making it usable by any program might not be simple if the compiler insists on always including the RTL in the executable.It only relies on system, not the complete rtl. QuoteHaving the RTL in a dll might even solve some problems in addition to sharing more code and making executables smaller. dll loading comes at a price and the memory footprint would be bigger, not smaller, although it may cosmettically look smaller. QuoteAll that said, I'm not fond of using UPX. Agreed. UPX has also a penalty in unpacking, hence UPX is no longer adviced by FPC core since over 6 years ago. It also triggers false positives frequently. QuoteETA: it's rather unlikely that the entire RTL can be put in a dll given that functions like writeln cannot be accurately described as an export. That is true for all compilerprocs/compiler magic, although some can be mitigated by wrapping OS calls, e.g. use wsprintf internally to wrap format() (as we do in KOL). OTOH suffers from the same dll issue since it depends on msvcrt.dll ---------------------------------------------------------------------- paule32 · 2025-05-27 06:49 to see, what I making of I post there an older version of Forms.pas on the Project of @fibonacci and me. @fibonacci contact me if you don't want that I open source this Part or partial code... https://dpaste.com/DBG6VPRZC Like you can see, I use two Parts: - 1 times a EXPORT define, and - 1 times a IMPORT define all EXPORT's goes into the DLL all IMPORT's goes into the EXE The EXE calls act like stub Functions, where the stub Functions lay in the DLL. Because FPC can not export CLASS or CLASS Methods - so I work with stub Functions. We have a little bit payload because this circumstances - but I have not found a better way without changing the FPC Compiler sources. Happy hacking ... ---------------------------------------------------------------------- Thaddy · 2025-05-27 07:11 Quote from: paule32 on May 27, 2025, 08:49:08 amtBecause FPC can not export CLASS or CLASS Methods - so I work with stub Functions. Well, tthat is not entirely true: this can be done because internally class instances are pointers. As long as the main program can see what that pointer means, you can instantiate classes from a dll. (You need a virtual abstract class on the program side).It is cumbersome, but can be done. And yes, that is hackery. ---------------------------------------------------------------------- cdbc · 2025-05-27 07:12 Hi But paule32 you CAN EXPORT interfaces! Both COM & CORBA  If you use managed types e.g.: COM or strings & arrays you need to use a shared memory manager, otherwise CORBA interfaces work just as well with only the C-API, just NO managed types... I use plugins this way "as a daily driver"  Regards Benny eta: Thaddy beat me to it, 2 approaches with basically the same result...ish ---------------------------------------------------------------------- Thaddy · 2025-05-27 07:15 Yes, basically using interfaces takes some of the hackery away, but class instances can be exported too. I used interfaces (COM) together with my commm.pas (a shared memory manager that is COM Marshalled) That would be early 2000's? The memory manager shoot-out? ---------------------------------------------------------------------- cdbc · 2025-05-27 07:26 Hi Yup Thaddy it was, about that time, I was also fiddling with memory- managers, back then =^ ...Good times in Delphi  @paule32: Here's a type-definition exported from a library, just to wet your appetite:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ///////////// IbcTaskThread / IbcSleepingThread ~ svc_taskthread.pas ////////////////   { task definitions we can handle "In Our Sleep" :o) }   { TTaskEvent = procedure(Sender: TObject) of object;  we call this with provided data }  TTaskEvent = TNotifyEvent;  { extended TTaskEvent, sig: TTaskEventEx = procedure(anObj: TObject;aPtr: pointer) of object; }  TTaskEventEx = procedure(anObj: TObject;aPtr: pointer) of object;  { TTaskFunc = function(Parameter: pointer): ptrint; we call this with provided data }  TTaskFunc = TThreadFunc;  { TTaskProc = procedure(aParam: pointer); or we also call this with provided data }  TTaskProc = procedure(aParam: pointer);  { designated error }  ETaskThreadError = class(Exception);  { TTaskThread is our base worker-bee, purely abstract here, will get overridden }  TTaskThread = class(TThread)  protected    fCaller: ptrint; { owner handle }    fID: ptrint; { own id, given to us by the controller }    fSync: IReadWriteSync; { our internal locking object }    fTaskEvent: TTaskEvent;     ///=^    fTaskEventEx: TTaskEventEx; ///=^    fTaskFunc: TTaskFunc;       ///=^    fTaskProc: TTaskProc;       ///=^    function get_ID: ptrint; virtual; abstract;    function get_Sync: IReadWriteSync; virtual; abstract;     function get_TaskEvent: TTaskEvent; virtual; abstract;   function get_TaskEventEx: TTaskEventEx; virtual; abstract;    function get_TaskFunc: TTaskFunc; virtual; abstract;    function get_TaskProc: TTaskProc; virtual; abstract;       procedure set_TaskEvent(aValue: TTaskEvent); virtual; abstract;    procedure set_TaskEventEx(aValue: TTaskEventEx); virtual; abstract;    procedure set_TaskFunc(aValue: TTaskFunc); virtual; abstract;    procedure set_TaskProc(aValue: TTaskProc); virtual; abstract;  public    property ID: ptrint read get_ID; { unprotected access }    property Sync: IReadWriteSync read get_Sync; { protection }           property TaskEvent: TTaskEvent read get_TaskEvent write set_TaskEvent; { protected access }    property TaskEventEx: TTaskEventEx read get_TaskEventEx write set_TaskEventEx; { protected access }    property TaskFunc: TTaskFunc read get_TaskFunc write set_TaskFunc; { protected access }    property TaskProc: TTaskProc read get_TaskProc write set_TaskProc; { protected access }  end; { TTaskThread }  { PThreadCtrlRec carries support data for each thread }  PThreadCtrlRec = ^TThreadCtrlRec;{$Interfaces CORBA} { refcounting OFF }  { IbcTaskThread is the corba/raw thread service that sleeps :o) and can be woken up,    to perform a task; be it a taskprocedure, a taskfunction(ThreadFunc) or a:    e.g.: 'class procedure ExecWait(Arg: pointer); static;' declared in a TForm \o/    messages posted in MsgQueue by the thread:      3683 = ENTE(r)  -> entering execute;      2344 = BEGI(n)  -> starting task      3464 = FINI(sh) -> finished task;         3663 = DONE     -> going to sleep      7867 = STOP     -> exiting execute, going out of business      -1   = ERRO(r)  -> caught some kind of error, text is in message.    Creation: "params = [hOwner: ptrint; aMsgQ: IbcMessageQueue64; aDbgMsg: boolean]" or none.      if not if not PluginMgr.GetSvc('IbcTaskThread','bcTaskThread',taskT) then raise except...;    (i) This gives you a BLIND THREAD i.e.: ^'type',     ^'name',     ^obj      taskT.HandleOwner:= Form1.Handle; -then you can do like this      taskT.MsgQ:= MQ;                  -instead you set    taskT.DebugMsg:= true;            -properties afterwards    or "pointer(taskT):= SvcMgr.GetSvcDefaultParams('IbcTaskThread',[Handle,fMsgQ,true]);"    or "PluginMgr.GetSvcDefaultParams('IbcTaskThread',[Handle,fMsgQ,true], taskT)"                                    i.e.:  ^type,     [^hForm,^MsgQ,^debugMsg(true/false)],obj    (!) NOTE: creating the thread with NIL as MsgQueue will give you NO MESSAGES!               setting 'DebugMsg' to false will have the same effect -^^-^^^^^^^^   (!) NOTE: Don't start 2 threads right after another, leave a little pause ~ 2 msecs between    (!) REMEMBER e.g.: itaskT.Obj.Free; when you're done (corba) }  ITaskThread = interface(ICorba)[SGUIDITaskThread]    { property getters and setters }    function get_Debug: boolean;      function get_HandleOwner: ptrint;    function get_Loaded: boolean;    function get_MsgQ: IbcMessageQueue64;    function get_Sleeping: boolean;    function get_Tcr: PThreadCtrlRec;    procedure set_Debug(aValue: boolean);     procedure set_HandleOwner(aValue: ptrint);    procedure set_MsgQ(aValue: IbcMessageQueue64);    procedure set_Tag(aValue: ptrint); // property    function Tag: ptrint; // property     { runs an extended TNotifyEvent, don't forget to synchronize / protect }    procedure CallEventEx(aTask: TTaskEventEx;anObj: TObject;aPtr: pointer);    { ExecTask carries out the specified task with the provided data, params:        aTask = a procedure that encapsulates the task at hand        aData = a pointer to the data necessary for the task to complete;      if the task produces a result, it must be returned in the 'aData' object.      Note: REMEMBER synchronization / protection of 'aData' }    procedure ExecTask(aTask: TTaskProc;aData: pointer);    { runs a standard TNotifyEvent, don't forget to synchronize / protect }    procedure RunEvent(aTask: TTaskEvent;aData: TObject);    { StartTask carries out the specified task with the provided data, params:        aTask = a function that encapsulates the task at hand (same as for 'BeginThread')        aData = a pointer to the data necessary for the task to complete;      if the task produces a result, it must be returned in the 'aData' object.      Note: REMEMBER synchronization / protection of 'aData' }    procedure StartTask(aTask: TTaskFunc;aData: pointer);    function Terminate: boolean;    property DebugMsg: boolean read get_Debug write set_Debug;     property HandleOwner: ptrint read get_HandleOwner write set_HandleOwner;    property Loaded: boolean read get_Loaded;    property MsgQ: IbcMessageQueue64 read get_MsgQ write set_MsgQ;    property Sleeping: boolean read get_Sleeping;    property Tcr: PThreadCtrlRec read get_Tcr;  end;  { IbcSleepingThread adds the possibility to change msgQ on the fly (not that you should);    can be woken up to perform a task; be it a taskprocedure, a taskfunction(ThreadFunc) or a:    e.g.: 'class procedure ExecWait(Arg: pointer); static;' declared in a TForm \o/    Creation = "constructor Create(hOwner: ptrint; aMsgQ: IbcMessageQueue64; aDbgMsg: boolean);"  messages posted in MsgQueue by the thread:      3683 = ENTE(r)  -> entering execute      2344 = BEGI(n)  -> starting task      3464 = FINI(sh) -> finished task      3663 = DONE     -> going to sleep      7867 = STOP     -> exiting execute, going out of business      -1   = ERRO(r)  -> caught some kind of error, text is in message.    (!) NOTE: creating the thread with NIL as MsgQueue will give you NO MESSAGES!               setting 'DebugMsg' to false will have the same effect -^^-^^^^^^^^    (!) NOTE: Don't start 2 threads right after another, leave a little pause ~ 2 msecs between    (!) REMEMBER e.g.: itaskT.Obj.Free; when you're done (corba) }  ISleepingThread = interface(ITaskThread)[SGUIDISleepingThread] end; { ISleepingThread }{$Interfaces COM} { refcounting back ON }  { TThreadCtrlRec carries support data for each thread }  TThreadCtrlRec = record    tcDataF: pointer;          { data for use in task-f }    tcDataP: pointer;        { data for use in task-p & taske-eventex }    tcEvent: IEvent;         { an event that controls the sleeping }    tcObjEv: TObject;        { data for use in task-event & taske-eventex }    tcSleeping: boolean;       { is the thread sleeping }    tcTerminated: boolean;   { has the thread been shutdown? }    tcThread: TTaskThread;     { a working thread, that sleeps and then carries out its task }  end; { TThreadCtrlRec } The above is housed in an .inc file... Regards Benny ---------------------------------------------------------------------- paule32 · 2025-05-27 09:18 @odbc Thank you for your catch-grocceries  I have to do some work in the kitchen on daylie week - so, I have to look how to split my free time with work time. All Code is experimental - I am not a pro - so, don't cry about my efforts. Feel free to drop a message if you have Question's about the Code or Part's of the Code... I'll be do my best, to get a working Result... Including @fibonacci - the team leader. EDIT: @440bx and what is your opinion, when UPX comes from a secure source like the FPC + Lazarus main server ? I think that the sources of UPX be laying by open source ? ---------------------------------------------------------------------- Thaddy · 2025-05-27 10:17 The problem is not UPX which is fine, but unpacking and executing binaries in memory. So anti-virus software chokes. Unpacking can not be done in-place by its very nature. It is very easy to mis-use UPX or equivalent packers. In the olden days I used it a lot to save disk space, but that is not really relevant anymore, because even a 128GB USB stick or memory card is $5. ---------------------------------------------------------------------- 440bx · 2025-05-27 10:23 Quote from: paule32 on May 27, 2025, 11:18:22 amEDIT: @440bx and what is your opinion, when UPX comes from a secure source like the FPC + Lazarus main server ? I think that the sources of UPX be laying by open source ? It's not about where the UPX exe comes from.  What I don't like about it is that by compressing the exe, it deceives the user into believing that the exe is smaller than it actually is.  Essentially, that dislike applies to any utility that compresses executables, not just UPX. The other thing I don't like about it (them, actually), is that it requires the data to be decompressed before it can be executed.  It is questionable that compressing the exe makes it ready to execute sooner.  In addition to that, the decompression process is yet another thing that can go wrong, i.e, if the exe does not behave as expected, is it because of a bug in the exe or is it because the decompression is faulty ? IOW, way too many real and potential problems to save a few kilobytes.  It just isn't worth the potential hassle. As @Thaddy posted, there could also be problems related to antiviruses too.  Again, the size gain is paltry at best and, the potential problems quite annoying.  It just isn't worth it. ---------------------------------------------------------------------- Thaddy · 2025-05-27 10:34 Btw, the bug report to remove UPX from the standard distribution was by me and Florian agreed. UPX used to be part of the standard distribution up until fpc 2.6.4. Just to give context. What UPX does is: - Use the MAIN entry point to enter its decompression code. - Allocate sufficient memory to decompress -  Decompress and move the code - Change entry point to the real code - Execute it That is called hackery.. It was brilliant in its time, but lost its purpose. ---------------------------------------------------------------------- paule32 · 2025-05-27 10:43 okay, I will privately use UPX, and when I distribute the binaries someone I will do it without UPX. But it is a wide way to do this - because @fibonacci don't want open source. And it is not guranteed, that our Project life in 5 years are on the Top of i386 Intel / amd64 - because Microsoft seems to be going to little ARM Terminals (no any more the Big Tower PC's in at the Service Desk's or in the private Home Room's by End-User) in the nearly Future. So, I would not write many Assembly Routines and get the Pascal way. This can be a Spot of Performance - but I think: better a running System instead stuckle in abroud Assembly Code... ---------------------------------------------------------------------- Thaddy · 2025-05-27 10:46 UPX itself has a VERY permissive license, so no, no problems. If it is sane is another matter: Better write a good installer, these compress too, but just once decompress. @Fibonacci? Why put him on the wrong track? ---------------------------------------------------------------------- paule32 · 2025-05-27 10:56 Quote from: Thaddy on May 27, 2025, 12:46:46 pm@Fibonacci? Why put him on the wrong track? I glued / thinking he is train me for a Team Project for a Firm/Corporation. And in a bigger Firm or little Corporation, there a many Protocolls and Papers that guide the Programmers what an Application shall have in and what not (for a Release or Business-Plan). I can not write or speak about the Project - because I am not admited to this. And who knows - maybe he will protect me before the Sharks in the Internet Green and Gray Ground. He give me Hints and Notes in a way like a Coucher - but without buy knowledge in with money. This is a great deal: - I learn new things - he get a level deeper to rest a little bit and get Power for new Projects - Like a Person that hold his Firm/Corporation running on with new Product's and Service's ... ---------------------------------------------------------------------- ASBzone · 2025-05-28 02:12 Quote from: 440bx on May 27, 2025, 12:23:15 pmIOW, way too many real and potential problems to save a few kilobytes.  It just isn't worth the potential hassle. It's a "solution" for a problem that no longer exists in mainstream computing environments, and now causes more problems than it solves. ---------------------------------------------------------------------- PascalDragon · 2025-06-02 20:33 Quote from: 440bx on May 27, 2025, 07:28:41 amI think that putting the entire FPC RTL in a dll is a good idea.  Making it usable by any program might not be simple if the compiler insists on always including the RTL in the executable. Having the RTL in a dll might even solve some problems in addition to sharing more code and making executables smaller. Well, with dynamic packages the result for chmls on Windows 64-bit back in 2019 were as follows: Code: [Select]1419896 chm.dll 1187518 fcl.base.dll 568559  fcl.res.dll 1602915 fcl.xml.dll 8347    rtl.c.dll 89978   rtl.console.dll 3647275 rtl.dll 345340  rtl.extra.dll 459357  rtl.generics.dll 601446  rtl.objpas.dll 85131   chmls.exe Quote from: 440bx on May 27, 2025, 07:28:41 amit's rather unlikely that the entire RTL can be put in a dll given that functions like writeln cannot be accurately described as an export. As said, with dynamic packages that can be done, however they rely on compiler functionality so they can't be used with other languages/compilers. Though dynamic packages aren't yet ready for prime time due to some problems that still exist on some platforms and the missing functionality to dynamically load packages at runtime (which is what Lazarus would use).