author Lars T Hansen <lhansen@mozilla.com>
Fri, 21 Jan 2022 15:37:21 +0000
changeset 673842 d435109964ecaeb5206be35306af79d7656ae630
parent 23964 ba15a84af7e6c364570feb7b5a66cea87ba460c8
permissions -rw-r--r--
Bug 1750930 - Make the indirect stub table two-level. r=yury, a=RyanVM For large applications with multiple threads and large tables of indirect functions and tiered compilation, the shared (per-module) indirect stubs set can easily reach one million entries. However the insert-one-at-a-time strategy for this set uses linear time, so merging a new set of stubs into the set will tend to take quadratic time. Furthermore, a lock is held by each thread during this slow process, serializing all the threads. The result can be very slow application startup. As a stopgap (because we may remove the indirect stubs and don't need to commit to a complex solution right now), we break the indirect stubs set it into per-tls sets to avoid the very long insertion times resulting from having one shared set per module. Set merging remains quadratic but the since the sets are much smaller it matters much less. A followup bug will be filed for a better, permanent solution, should we need it. Differential Revision: https://phabricator.services.mozilla.com/D136470

  NSIS ExDLL2 example
  Original is ExDLL
  (C) 2001 - Peter Windridge

  Changed with delphi unit nsis.pas
  by bernhard mayer

  Tested in Delphi 7.0

library exdll;

  nsis, windows;

procedure ex_dll(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer); cdecl;
  // set up global variables
  Init(hwndParent, string_size, variables, stacktop);

  NSISDialog(GetUserVariable(INST_0), 'The value of $0', MB_OK);
  NSISDialog(PopString, 'pop', MB_OK);
  PushString('Hello, this is a push');
  SetUserVariable(INST_0, 'This is user var $0');

exports ex_dll;