FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour libharbour.dll virtual machine activity on dbwin32
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
libharbour.dll virtual machine activity on dbwin32
Posted: Sat Oct 23, 2021 02:33 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: libharbour.dll virtual machine activity on dbwin32
Posted: Sun Oct 24, 2021 04:39 PM

Mr. Linares,

Incredible the calls that are made to hb_xbfree.

C.

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: libharbour.dll virtual machine activity on dbwin32
Posted: Sun Oct 24, 2021 04:46 PM

Dear Antonio,
Can you please explain what these tests are about?
Best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: libharbour.dll virtual machine activity on dbwin32
Posted: Mon Oct 25, 2021 08:57 AM
Dear Otto,

we have found that building Harbour with these flags:

set HB_USER_CFLAGS=-DHB_FM_STATISTICS_OFF -DHB_FM_WIN_ALLOC

the resulting libharbour.dll manages memory much better, as we use the standard Windows API LocalAlloc(), LocalRealloc(), LocalFree(), etc to manage the memory on Windows

Also, modifying mod_harbour's entry.c this way (two calls to OutputDebugString()) makes memory liberation work much better:
Code (fw): Select all Collapse
#include <Windows.h>
#include <hbapi.h>
#include <hbvm.h>

static void * pRequestRec;

HB_EXPORT_ATTR int hb_apache( void * _pRequestRec )
{
   int iResult;

   pRequestRec = _pRequestRec;
 
   hb_vmInit( HB_TRUE );
   OutputDebugString( "after hb_vmInit()\n" );
   iResult = hb_vmQuit();
   OutputDebugString( "after hb_vmQuit()\n" );
   return iResult;
}   

void * GetRequestRec( void )
{
   return pRequestRec;
}

HB_FUNC( AP_ENTRY )
{
   hb_apache( NULL );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion