anchor.diff:    MemoryManager.Standard.RegisterExpectedMemoryLeak := BrainMMRegisterExpectedMemoryLeak;
     MemoryManager.Standard.UnregisterExpectedMemoryLeak := BrainMMUnregisterExpectedMemoryLeak;
   
  -  // todo
  -
  -
  -  {$ifdef BRAINMM_REDIRECT}
  -    if (not System.IsLibrary) then
  -      BrainMMRedirectInitialize;
  +  {$ifdef MSWINDOWS}
  +  begin
  +    Move(BRAINMM_MARKER, Buffer, SizeOf(BRAINMM_MARKER));
  +    ProcessId := GetCurrentProcessId;
  +    for i := 0 to 7 do
  +    begin
  +      Buffer[High(Buffer) - 1 - i] := HEX_CHARS[ProcessId and $f];
  +      ProcessId := ProcessId shr 4;
  +    end;
  +    Buffer[High(Buffer)] := #0;
  +
  +    Handle := FindWindowA('STATIC', Buffer);
  +    if (Handle = 0) then
  +    begin
  +      Handle := CreateWindowA('STATIC', Buffer, WS_POPUP, 0, 0, 0, 0, 0, 0, HInstance, nil);
  +      SetWindowLong(Handle, GWL_USERDATA, NativeInt(@MemoryManager));
  +
  +     {$ifdef BRAINMM_REDIRECT}
  +       BrainMMRedirectInitialize;
  +     {$endif}
  +    end else
  +    begin
  +      BrainMMRegistered := Pointer(GetWindowLong(Handle, GWL_USERDATA));
  +
  +      for i := Low(BrainMMRegistered.POINTERS) to High(BrainMMRegistered.POINTERS) do
  +      if (BrainMMRegistered.POINTERS[i] <> nil) then
  +        MemoryManager.POINTERS[i] := BrainMMRegistered.POINTERS[i];
  +    end;
  +  end;
     {$endif}
   
     {$if Defined(BRAINMM_REDIRECT) and Defined(CPUX86)}
  
positive.code:   {$if Defined(FPC) or (CompilerVersion >= 18)}
      {$define OPERATORSUPPORT}
    {$ifend}
  {$else}
    {$define CPUINTEL}
    {$define SMALLINT}
  
negative.code: {$ifend}
  type
    PMemoryMgr = {$ifdef MEMORYMANAGEREX}^TMemoryManagerEx{$else}^TMemoryManager{$endif};
  {$ifdef MSWINDOWS}
  const
    BRAINMM_MARKER: array[1..15] of AnsiChar = 'BrainMM_Marker_';
    HEX_CHARS: array[0..15] of AnsiChar = '0123456789ABCDEF';
  var
    i: Integer;
    ProcessId: Cardinal;
    Buffer: array[0..SizeOf(BRAINMM_MARKER) + 8] of AnsiChar;
    Handle: HWND;
    BrainMMRegistered: ^TBrainMemoryManager;
  {$endif}
  begin
    InitializeOffsetsMedium;
  
  