libharbour.dll virtual machine activity on dbwin32

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

libharbour.dll virtual machine activity on dbwin32

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Carles
Posts: 1149
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Been thanked: 7 times
Contact:

Re: libharbour.dll virtual machine activity on dbwin32

Post by Carles »

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
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 21 times
Been thanked: 2 times
Contact:

Re: libharbour.dll virtual machine activity on dbwin32

Post by Otto »

Dear Antonio,
Can you please explain what these tests are about?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

Re: libharbour.dll virtual machine activity on dbwin32

Post by Antonio Linares »

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: Select all | Expand

#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
Post Reply