2012-11-21 17:50 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/rdd/hsx/hsx.c
* src/rtl/gtxwc/gtxwc.c
* src/vm/classes.c
* src/vm/dynsym.c
* src/vm/garbage.c
* modified macros to act like functions, whether
mapped to noop or noop code. These code parts
will now not confuse code formatters.
The generated code is indentical (tested under
mingw, and to some extent on msvc and bcc)
* include/hbtrace.h
* minor
This commit is contained in:
@@ -10,6 +10,21 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2012-11-21 17:50 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* src/rdd/hsx/hsx.c
|
||||
* src/rtl/gtxwc/gtxwc.c
|
||||
* src/vm/classes.c
|
||||
* src/vm/dynsym.c
|
||||
* src/vm/garbage.c
|
||||
* modified macros to act like functions, whether
|
||||
mapped to noop or noop code. These code parts
|
||||
will now not confuse code formatters.
|
||||
The generated code is indentical (tested under
|
||||
mingw, and to some extent on msvc and bcc)
|
||||
|
||||
* include/hbtrace.h
|
||||
* minor
|
||||
|
||||
2012-11-21 16:20 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbsqlit3/core.c
|
||||
* contrib/rddsql/sqlbase.c
|
||||
|
||||
@@ -218,21 +218,21 @@ typedef struct
|
||||
}
|
||||
HB_TRACEINFO, * PHB_TRACEINFO;
|
||||
|
||||
extern HB_EXPORT int hb_tracestate( int new_state );
|
||||
extern HB_EXPORT int hb_tracelevel( int new_level );
|
||||
extern HB_EXPORT int hb_traceflush( int new_flush );
|
||||
extern HB_EXPORT int hb_tracesysout( int new_sysout );
|
||||
extern HB_EXPORT const char * hb_tracemode( const char * szNewMode );
|
||||
extern HB_EXPORT HB_BOOL hb_tracefile( const char * szFile );
|
||||
extern HB_EXPORT int hb_tracestate( int new_state );
|
||||
extern HB_EXPORT int hb_tracelevel( int new_level );
|
||||
extern HB_EXPORT int hb_traceflush( int new_flush );
|
||||
extern HB_EXPORT int hb_tracesysout( int new_sysout );
|
||||
extern HB_EXPORT const char * hb_tracemode( const char * szNewMode );
|
||||
extern HB_EXPORT HB_BOOL hb_tracefile( const char * szFile );
|
||||
|
||||
extern HB_EXPORT void hb_tracelog( int level, const char * file, int line, const char * proc, const char * fmt, ... ) HB_PRINTF_FORMAT( 5, 6 );
|
||||
extern HB_EXPORT void hb_tracelog( int level, const char * file, int line, const char * proc, const char * fmt, ... ) HB_PRINTF_FORMAT( 5, 6 );
|
||||
|
||||
extern HB_EXPORT void hb_traceset( int level, const char * file, int line, const char * proc );
|
||||
extern HB_EXPORT void hb_traceset( int level, const char * file, int line, const char * proc );
|
||||
extern HB_EXPORT PHB_TRACEINFO hb_traceinfo( void );
|
||||
|
||||
extern HB_EXPORT int hb_tr_level( void );
|
||||
extern HB_EXPORT void hb_tr_trace( const char * fmt, ... ) HB_PRINTF_FORMAT( 1, 2 );
|
||||
extern HB_EXPORT void hb_tr_stealth( const char * fmt, ... ) HB_PRINTF_FORMAT( 1, 2 );
|
||||
extern HB_EXPORT int hb_tr_level( void );
|
||||
extern HB_EXPORT void hb_tr_trace( const char * fmt, ... ) HB_PRINTF_FORMAT( 1, 2 );
|
||||
extern HB_EXPORT void hb_tr_stealth( const char * fmt, ... ) HB_PRINTF_FORMAT( 1, 2 );
|
||||
|
||||
HB_EXTERN_END
|
||||
|
||||
|
||||
@@ -357,8 +357,8 @@ HSXTABLE, * LPHSXTABLE;
|
||||
|
||||
#include "hbstack.h"
|
||||
|
||||
#define HB_HSX_LOCK
|
||||
#define HB_HSX_UNLOCK
|
||||
#define HB_HSX_LOCK() do {} while( 0 )
|
||||
#define HB_HSX_UNLOCK() do {} while( 0 )
|
||||
|
||||
static int hb_hsxDestroy( int iHandle );
|
||||
|
||||
@@ -386,8 +386,8 @@ static HSXTABLE s_hsxTable;
|
||||
#define hb_hsxTable() ( &s_hsxTable )
|
||||
|
||||
static HB_CRITICAL_NEW( s_hsxMtx );
|
||||
#define HB_HSX_LOCK hb_threadEnterCriticalSection( &s_hsxMtx );
|
||||
#define HB_HSX_UNLOCK hb_threadLeaveCriticalSection( &s_hsxMtx );
|
||||
#define HB_HSX_LOCK() hb_threadEnterCriticalSection( &s_hsxMtx )
|
||||
#define HB_HSX_UNLOCK() hb_threadLeaveCriticalSection( &s_hsxMtx )
|
||||
|
||||
#endif
|
||||
|
||||
@@ -559,13 +559,13 @@ static LPHSXINFO hb_hsxGetPointer( int iHandle )
|
||||
{
|
||||
LPHSXINFO pHSX = NULL;
|
||||
|
||||
HB_HSX_LOCK
|
||||
HB_HSX_LOCK();
|
||||
{
|
||||
LPHSXTABLE pTable = hb_hsxTable();
|
||||
if( iHandle >= 0 && iHandle < pTable->iHandleSize )
|
||||
pHSX = pTable->handleArray[ iHandle ];
|
||||
}
|
||||
HB_HSX_UNLOCK
|
||||
HB_HSX_UNLOCK();
|
||||
|
||||
return pHSX;
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ static LPHSXINFO hb_hsxNew( void )
|
||||
int iHandle = 0;
|
||||
LPHSXTABLE pTable;
|
||||
|
||||
HB_HSX_LOCK
|
||||
HB_HSX_LOCK();
|
||||
|
||||
pTable = hb_hsxTable();
|
||||
if( pTable->iHandleSize == 0 )
|
||||
@@ -1260,7 +1260,7 @@ static LPHSXINFO hb_hsxNew( void )
|
||||
pHSX->iHandle = iHandle;
|
||||
pHSX->pFile = NULL;
|
||||
|
||||
HB_HSX_UNLOCK
|
||||
HB_HSX_UNLOCK();
|
||||
|
||||
return pHSX;
|
||||
}
|
||||
@@ -1348,7 +1348,7 @@ static int hb_hsxDestroy( int iHandle )
|
||||
|
||||
iRetVal = hb_hsxFlushAll( iHandle );
|
||||
|
||||
HB_HSX_LOCK
|
||||
HB_HSX_LOCK();
|
||||
{
|
||||
LPHSXTABLE pTable = hb_hsxTable();
|
||||
if( iHandle >= 0 && iHandle < pTable->iHandleSize &&
|
||||
@@ -1364,7 +1364,7 @@ static int hb_hsxDestroy( int iHandle )
|
||||
}
|
||||
}
|
||||
}
|
||||
HB_HSX_UNLOCK
|
||||
HB_HSX_UNLOCK();
|
||||
|
||||
if( pHSX )
|
||||
{
|
||||
|
||||
@@ -74,11 +74,11 @@ static HB_GT_FUNCS SuperTable;
|
||||
|
||||
#ifdef HB_XWC_XLIB_NEEDLOCKS
|
||||
static HB_CRITICAL_NEW( s_xwcMtx );
|
||||
# define HB_XWC_XLIB_LOCK hb_threadEnterCriticalSection( &s_xwcMtx );
|
||||
# define HB_XWC_XLIB_UNLOCK hb_threadLeaveCriticalSection( &s_xwcMtx );
|
||||
# define HB_XWC_XLIB_LOCK() hb_threadEnterCriticalSection( &s_xwcMtx )
|
||||
# define HB_XWC_XLIB_UNLOCK() hb_threadLeaveCriticalSection( &s_xwcMtx )
|
||||
#else
|
||||
# define HB_XWC_XLIB_LOCK
|
||||
# define HB_XWC_XLIB_UNLOCK
|
||||
# define HB_XWC_XLIB_LOCK() do {} while( 0 )
|
||||
# define HB_XWC_XLIB_UNLOCK() do {} while( 0 )
|
||||
#endif
|
||||
|
||||
/* mouse button mapping into Clipper keycodes */
|
||||
@@ -4025,7 +4025,7 @@ static void hb_gt_xwc_ProcessMessages( PXWND_DEF wnd, HB_BOOL fSync )
|
||||
}
|
||||
}
|
||||
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
hb_gt_xwc_UpdateChr( wnd );
|
||||
|
||||
@@ -4077,7 +4077,7 @@ static void hb_gt_xwc_ProcessMessages( PXWND_DEF wnd, HB_BOOL fSync )
|
||||
}
|
||||
#endif
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
|
||||
}
|
||||
|
||||
@@ -4192,7 +4192,7 @@ static void hb_gt_xwc_ClearSelection( PXWND_DEF wnd )
|
||||
|
||||
static void hb_gt_xwc_SetSelection( PXWND_DEF wnd, const char * szData, HB_SIZE ulSize, HB_BOOL fCopy )
|
||||
{
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
if( ulSize == 0 )
|
||||
hb_gt_xwc_ClearSelection( wnd );
|
||||
@@ -4232,7 +4232,7 @@ static void hb_gt_xwc_SetSelection( PXWND_DEF wnd, const char * szData, HB_SIZE
|
||||
}
|
||||
}
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
@@ -4260,7 +4260,7 @@ static void hb_gt_xwc_RequestSelection( PXWND_DEF wnd )
|
||||
if( aRequest == None )
|
||||
break;
|
||||
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
#ifdef XWC_DEBUG
|
||||
printf( "XConvertSelection: %ld (%s)\r\n", aRequest,
|
||||
@@ -4269,7 +4269,7 @@ static void hb_gt_xwc_RequestSelection( PXWND_DEF wnd )
|
||||
XConvertSelection( wnd->dpy, s_atomPrimary, aRequest,
|
||||
s_atomCutBuffer0, wnd->window, wnd->lastEventTime );
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
|
||||
if( s_updateMode == XWC_ASYNC_UPDATE )
|
||||
@@ -4394,14 +4394,14 @@ static HB_BOOL hb_gt_xwc_ConnectX( PXWND_DEF wnd, HB_BOOL fExit )
|
||||
if( wnd->dpy != NULL )
|
||||
return HB_TRUE;
|
||||
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
/* with NULL, it gets the DISPLAY environment variable. */
|
||||
wnd->dpy = XOpenDisplay( NULL );
|
||||
|
||||
if( wnd->dpy == NULL )
|
||||
{
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
if( fExit )
|
||||
{
|
||||
/* TODO: a standard Harbour error should be generated here when
|
||||
@@ -4433,14 +4433,14 @@ static HB_BOOL hb_gt_xwc_ConnectX( PXWND_DEF wnd, HB_BOOL fExit )
|
||||
s_atomFullScreen = XInternAtom( wnd->dpy, "_NET_WM_STATE_FULLSCREEN", False );
|
||||
s_atomState = XInternAtom( wnd->dpy, "_NET_WM_STATE", False );
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
|
||||
return HB_TRUE;
|
||||
}
|
||||
|
||||
static void hb_gt_xwc_DissConnectX( PXWND_DEF wnd )
|
||||
{
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
if( wnd->dpy != NULL )
|
||||
{
|
||||
@@ -4492,7 +4492,7 @@ static void hb_gt_xwc_DissConnectX( PXWND_DEF wnd )
|
||||
s_fIgnoreErrors = HB_TRUE;
|
||||
}
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
@@ -4556,7 +4556,7 @@ static void hb_gt_xwc_CreateWindow( PXWND_DEF wnd )
|
||||
{
|
||||
HB_BOOL fResizable = wnd->fResizable;
|
||||
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
|
||||
/* load the standard font */
|
||||
if( ! wnd->szFontSel )
|
||||
@@ -4565,7 +4565,7 @@ static void hb_gt_xwc_CreateWindow( PXWND_DEF wnd )
|
||||
{
|
||||
if( ! hb_gt_xwc_SetFont( wnd, XWC_DEFAULT_FONT_NAME, XWC_DEFAULT_FONT_WEIGHT, XWC_DEFAULT_FONT_HEIGHT, XWC_DEFAULT_FONT_ENCODING ) )
|
||||
{
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
|
||||
/* TODO: a standard Harbour error should be generated here when
|
||||
it can run without console!
|
||||
@@ -4655,7 +4655,7 @@ static void hb_gt_xwc_CreateWindow( PXWND_DEF wnd )
|
||||
hb_gt_xwc_SetResizing( wnd );
|
||||
}
|
||||
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
@@ -4786,9 +4786,9 @@ static HB_BOOL hb_gt_xwc_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
else
|
||||
{
|
||||
hb_gt_xwc_Disable();
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
fResult = hb_gt_xwc_Resize( wnd, iCol, iRow );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_Enable();
|
||||
|
||||
/* hack for multiple window resizing when user executes
|
||||
@@ -4869,10 +4869,10 @@ static void hb_gt_xwc_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
XkbCtrl.bell_pitch = ( int ) dFrequency;
|
||||
XkbCtrl.bell_duration = ( int ) ( dDuration * 1000 );
|
||||
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XChangeKeyboardControl( wnd->dpy, KBBellPitch | KBBellDuration, &XkbCtrl );
|
||||
XBell( wnd->dpy, 0 );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
hb_idleSleep( dDuration );
|
||||
}
|
||||
@@ -5058,11 +5058,11 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
pInfo->pResult = hb_itemPutC( pInfo->pResult, wnd->szFontSel );
|
||||
if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING )
|
||||
{
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
if( hb_gt_xwc_SetFont( wnd, hb_itemGetCPtr( pInfo->pNewVal ), NULL, 0, NULL ) &&
|
||||
wnd->fInit )
|
||||
hb_gt_xwc_CreateWindow( wnd );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -5086,9 +5086,9 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
case HB_GTI_DESKTOPROWS:
|
||||
{
|
||||
XWindowAttributes wndAttr;
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XGetWindowAttributes( wnd->dpy, DefaultRootWindow( wnd->dpy ), &wndAttr );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
switch( iType )
|
||||
{
|
||||
case HB_GTI_DESKTOPWIDTH:
|
||||
@@ -5215,9 +5215,9 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
wnd->fResizable = ( iVal != 0 );
|
||||
if( wnd->fInit )
|
||||
{
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
hb_gt_xwc_SetResizing( wnd );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5390,9 +5390,9 @@ static int hb_gt_xwc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft,
|
||||
color.green = iLeft * 256;
|
||||
color.blue = iBottom * 256;
|
||||
color.flags = DoRed | DoGreen | DoBlue;
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
hb_gt_xwc_AllocColor( wnd, &color );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
iRet = color.pixel;
|
||||
break;
|
||||
|
||||
@@ -5417,9 +5417,9 @@ static int hb_gt_xwc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft,
|
||||
wnd->ClipRect.x = iLeft;
|
||||
wnd->ClipRect.width = iBottom;
|
||||
wnd->ClipRect.height = iRight;
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetClipRectangles( wnd->dpy, wnd->gc, 0, 0, &wnd->ClipRect, 1, YXBanded );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
break;
|
||||
|
||||
case HB_GFX_DRAWINGMODE:
|
||||
@@ -5432,76 +5432,76 @@ static int hb_gt_xwc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft,
|
||||
break;
|
||||
|
||||
case HB_GFX_PUTPIXEL:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iBottom );
|
||||
XDrawPoint( wnd->dpy, wnd->drw, wnd->gc, iLeft, iTop );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft, iTop, iLeft, iTop );
|
||||
break;
|
||||
|
||||
case HB_GFX_LINE:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iColor );
|
||||
XDrawLine( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iRight, iBottom );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft, iTop, iRight, iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_RECT:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iColor );
|
||||
XDrawRectangle( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iRight - iLeft, iBottom - iTop );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft, iTop, iRight, iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_FILLEDRECT:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iColor );
|
||||
XFillRectangle( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iRight - iLeft, iBottom - iTop );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft, iTop, iRight, iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_CIRCLE:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iRight );
|
||||
XDrawArc( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iBottom, iBottom, 0, 360*64 );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft - iBottom, iTop - iBottom,
|
||||
iLeft + iBottom, iTop + iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_FILLEDCIRCLE:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iRight );
|
||||
XFillArc( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iBottom, iBottom, 0, 360*64 );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft - iBottom, iTop - iBottom,
|
||||
iLeft + iBottom, iTop + iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_ELLIPSE:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iColor );
|
||||
XDrawArc( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iRight, iBottom, 0, 360*64 );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft - iRight, iTop - iBottom,
|
||||
iLeft + iRight, iTop + iBottom );
|
||||
break;
|
||||
|
||||
case HB_GFX_FILLEDELLIPSE:
|
||||
HB_XWC_XLIB_LOCK
|
||||
HB_XWC_XLIB_LOCK();
|
||||
XSetForeground( wnd->dpy, wnd->gc, iColor );
|
||||
XFillArc( wnd->dpy, wnd->drw, wnd->gc,
|
||||
iLeft, iTop, iRight, iBottom, 0, 360*64 );
|
||||
HB_XWC_XLIB_UNLOCK
|
||||
HB_XWC_XLIB_UNLOCK();
|
||||
hb_gt_xwc_InvalidatePts( wnd, iLeft - iRight, iTop - iBottom,
|
||||
iLeft + iRight, iTop + iBottom );
|
||||
break;
|
||||
|
||||
@@ -388,15 +388,15 @@ static HB_USHORT s_uiObjectClass = 0;
|
||||
# include "hbthread.h"
|
||||
|
||||
# define HB_CLASS_POOL_SIZE 16384
|
||||
# define HB_CLASS_LOCK hb_threadEnterCriticalSection( &s_clsMtx );
|
||||
# define HB_CLASS_UNLOCK hb_threadLeaveCriticalSection( &s_clsMtx );
|
||||
# define HB_CLASS_LOCK() hb_threadEnterCriticalSection( &s_clsMtx )
|
||||
# define HB_CLASS_UNLOCK() hb_threadLeaveCriticalSection( &s_clsMtx )
|
||||
static HB_CRITICAL_NEW( s_clsMtx );
|
||||
|
||||
#else
|
||||
|
||||
# define HB_CLASS_POOL_SIZE 0
|
||||
# define HB_CLASS_LOCK
|
||||
# define HB_CLASS_UNLOCK
|
||||
# define HB_CLASS_LOCK() do {} while( 0 )
|
||||
# define HB_CLASS_UNLOCK() do {} while( 0 )
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3231,7 +3231,7 @@ static HB_USHORT hb_clsNew( const char * szClassName, HB_USHORT uiDatas,
|
||||
pNewCls = ( PCLASS ) hb_xgrab( sizeof( CLASS ) );
|
||||
memset( pNewCls, 0, sizeof( CLASS ) );
|
||||
|
||||
HB_CLASS_LOCK
|
||||
HB_CLASS_LOCK();
|
||||
|
||||
if( s_uiClasses == s_uiClsSize )
|
||||
{
|
||||
@@ -3242,7 +3242,7 @@ static HB_USHORT hb_clsNew( const char * szClassName, HB_USHORT uiDatas,
|
||||
s_pClasses[ ++s_uiClasses ] = pNewCls;
|
||||
pNewCls->uiClass = s_uiClasses;
|
||||
|
||||
HB_CLASS_UNLOCK
|
||||
HB_CLASS_UNLOCK();
|
||||
|
||||
pNewCls->szName = hb_strdup( szClassName );
|
||||
pNewCls->pClassSym = hb_dynsymGet( pNewCls->szName );
|
||||
@@ -5060,7 +5060,7 @@ HB_FUNC( __CLSPREALLOCATE )
|
||||
if( lNewSize > ( HB_LONG ) USHRT_MAX )
|
||||
lNewSize = USHRT_MAX;
|
||||
|
||||
HB_CLASS_LOCK
|
||||
HB_CLASS_LOCK();
|
||||
|
||||
if( lNewSize > ( HB_LONG ) s_uiClsSize )
|
||||
{
|
||||
@@ -5069,7 +5069,7 @@ HB_FUNC( __CLSPREALLOCATE )
|
||||
( ( HB_SIZE ) s_uiClsSize + 1 ) );
|
||||
}
|
||||
|
||||
HB_CLASS_UNLOCK
|
||||
HB_CLASS_UNLOCK();
|
||||
|
||||
hb_retnl( s_uiClsSize );
|
||||
}
|
||||
|
||||
@@ -74,15 +74,15 @@ HB_SYM_HOLDER, * PHB_SYM_HOLDER;
|
||||
# include "hbthread.h"
|
||||
|
||||
static HB_CRITICAL_NEW( s_dynsMtx );
|
||||
# define HB_DYNSYM_LOCK hb_threadEnterCriticalSection( &s_dynsMtx );
|
||||
# define HB_DYNSYM_UNLOCK hb_threadLeaveCriticalSection( &s_dynsMtx );
|
||||
# define HB_DYNSYM_LOCK() hb_threadEnterCriticalSection( &s_dynsMtx )
|
||||
# define HB_DYNSYM_UNLOCK() hb_threadLeaveCriticalSection( &s_dynsMtx )
|
||||
|
||||
# define hb_dynsymHandles( p ) hb_stackGetDynHandle( p )
|
||||
|
||||
#else
|
||||
|
||||
# define HB_DYNSYM_LOCK
|
||||
# define HB_DYNSYM_UNLOCK
|
||||
# define HB_DYNSYM_LOCK() do {} while( 0 )
|
||||
# define HB_DYNSYM_UNLOCK() do {} while( 0 )
|
||||
|
||||
# define hb_dynsymHandles( p ) ( p )
|
||||
|
||||
@@ -99,7 +99,7 @@ static PDYNHB_ITEM s_pDynIndex = NULL;
|
||||
static int s_iDynIdxSize = 0;
|
||||
|
||||
/* Insert new symbol into dynamic symbol table.
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK()
|
||||
*/
|
||||
static PHB_DYNS hb_dynsymInsert( PHB_SYMB pSymbol, HB_UINT uiPos )
|
||||
{
|
||||
@@ -135,7 +135,7 @@ static PHB_DYNS hb_dynsymInsert( PHB_SYMB pSymbol, HB_UINT uiPos )
|
||||
|
||||
/* Find symbol in dynamic symbol table and set it's position.
|
||||
* If not found set position for insert operation.
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK()
|
||||
*/
|
||||
static PHB_DYNS hb_dynsymPos( const char * szName, HB_UINT * puiPos )
|
||||
{
|
||||
@@ -169,7 +169,7 @@ static PHB_DYNS hb_dynsymPos( const char * szName, HB_UINT * puiPos )
|
||||
}
|
||||
|
||||
/* Create new symbol.
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK
|
||||
* In MT mode caller should protected it by HB_DYNSYM_LOCK()
|
||||
*/
|
||||
static PHB_SYMB hb_symbolAlloc( const char * szName )
|
||||
{
|
||||
@@ -199,7 +199,7 @@ PHB_DYNS hb_dynsymFind( const char * szName )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymFind(%s)", szName ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
uiFirst = 0;
|
||||
uiLast = s_uiDynSymbols;
|
||||
@@ -211,7 +211,7 @@ PHB_DYNS hb_dynsymFind( const char * szName )
|
||||
|
||||
if( iCmp == 0 )
|
||||
{
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
return s_pDynItems[ uiMiddle ].pDynSym;
|
||||
}
|
||||
else if( iCmp < 0 )
|
||||
@@ -220,7 +220,7 @@ PHB_DYNS hb_dynsymFind( const char * szName )
|
||||
uiFirst = uiMiddle + 1;
|
||||
}
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -232,11 +232,11 @@ PHB_SYMB hb_symbolNew( const char * szName )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_symbolNew(%s)", szName ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
pSymbol = hb_symbolAlloc( szName );
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return pSymbol;
|
||||
}
|
||||
@@ -249,7 +249,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymNew(%p)", pSymbol ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
pDynSym = hb_dynsymPos( pSymbol->szName, &uiPos ); /* Find position */
|
||||
if( ! pDynSym )
|
||||
@@ -305,7 +305,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol )
|
||||
* In such case update pDynSym address in the new symbol but
|
||||
* do not register it as the main one
|
||||
*/
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
return pDynSym; /* Return pointer to DynSym */
|
||||
}
|
||||
/* The multiple symbols comes from single binaries - we have to
|
||||
@@ -356,7 +356,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol )
|
||||
}
|
||||
}
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return pDynSym;
|
||||
}
|
||||
@@ -369,13 +369,13 @@ PHB_DYNS hb_dynsymGetCase( const char * szName )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymGetCase(%s)", szName ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
pDynSym = hb_dynsymPos( szName, &uiPos );
|
||||
if( ! pDynSym )
|
||||
pDynSym = hb_dynsymInsert( hb_symbolAlloc( szName ), uiPos );
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return pDynSym;
|
||||
}
|
||||
@@ -515,12 +515,12 @@ static PHB_DYNS hb_dynsymGetByIndex( HB_LONG lIndex )
|
||||
{
|
||||
PHB_DYNS pDynSym = NULL;
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
if( lIndex >= 1 && lIndex <= s_uiDynSymbols )
|
||||
pDynSym = s_pDynItems[ lIndex - 1 ].pDynSym;
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return pDynSym;
|
||||
}
|
||||
@@ -538,7 +538,7 @@ int hb_dynsymToNum( PHB_DYNS pDynSym )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymToNum(%p)", pDynSym ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
iSymNum = pDynSym->uiSymNum;
|
||||
|
||||
@@ -554,7 +554,7 @@ int hb_dynsymToNum( PHB_DYNS pDynSym )
|
||||
if( s_pDynIndex[ iSymNum - 1 ].pDynSym == NULL )
|
||||
s_pDynIndex[ iSymNum - 1 ].pDynSym = pDynSym;
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return iSymNum;
|
||||
}
|
||||
@@ -565,12 +565,12 @@ PHB_DYNS hb_dynsymFromNum( int iSymNum )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymFromNum(%d)", iSymNum ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
pDynSym = iSymNum > 0 && iSymNum <= s_iDynIdxSize ?
|
||||
s_pDynIndex[ iSymNum - 1 ].pDynSym : NULL;
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
return pDynSym;
|
||||
}
|
||||
@@ -585,7 +585,7 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
for( ;; )
|
||||
{
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
if( pDynSym )
|
||||
{
|
||||
@@ -603,7 +603,7 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
else
|
||||
pDynSym = NULL;
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
|
||||
if( ! pDynSym || ! ( pFunction ) ( pDynSym, Cargo ) )
|
||||
break;
|
||||
@@ -616,7 +616,7 @@ void hb_dynsymProtectEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymProtectEval(%p, %p)", pFunction, Cargo ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
while( uiPos < s_uiDynSymbols )
|
||||
{
|
||||
@@ -624,14 +624,14 @@ void hb_dynsymProtectEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
break;
|
||||
}
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
}
|
||||
|
||||
void hb_dynsymRelease( void )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymRelease()" ) );
|
||||
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
if( s_iDynIdxSize )
|
||||
{
|
||||
@@ -658,7 +658,7 @@ void hb_dynsymRelease( void )
|
||||
hb_xfree( pHolder );
|
||||
}
|
||||
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
}
|
||||
|
||||
HB_FUNC( __DYNSCOUNT ) /* How much symbols do we have: dsCount = __dynsymCount() */
|
||||
@@ -687,10 +687,10 @@ HB_FUNC( __DYNSGETINDEX ) /* Gimme index number of symbol: dsIndex = __dynsymGet
|
||||
pDynSym = hb_dynsymFindName( szName );
|
||||
if( pDynSym )
|
||||
{
|
||||
HB_DYNSYM_LOCK
|
||||
HB_DYNSYM_LOCK();
|
||||
if( ! hb_dynsymPos( pDynSym->pSymbol->szName, &uiPos ) )
|
||||
uiPos = 0;
|
||||
HB_DYNSYM_UNLOCK
|
||||
HB_DYNSYM_UNLOCK();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,21 +76,21 @@
|
||||
# if defined( HB_SPINLOCK_INIT ) && 1
|
||||
|
||||
HB_SPINLOCK_T s_gcSpinLock = HB_SPINLOCK_INIT;
|
||||
# define HB_GC_LOCK HB_SPINLOCK_ACQUIRE( &s_gcSpinLock );
|
||||
# define HB_GC_UNLOCK HB_SPINLOCK_RELEASE( &s_gcSpinLock );
|
||||
# define HB_GC_LOCK() HB_SPINLOCK_ACQUIRE( &s_gcSpinLock )
|
||||
# define HB_GC_UNLOCK() HB_SPINLOCK_RELEASE( &s_gcSpinLock )
|
||||
|
||||
# else
|
||||
|
||||
static HB_CRITICAL_NEW( s_gcMtx );
|
||||
# define HB_GC_LOCK hb_threadEnterCriticalSection( &s_gcMtx );
|
||||
# define HB_GC_UNLOCK hb_threadLeaveCriticalSection( &s_gcMtx );
|
||||
# define HB_GC_LOCK() hb_threadEnterCriticalSection( &s_gcMtx )
|
||||
# define HB_GC_UNLOCK() hb_threadLeaveCriticalSection( &s_gcMtx )
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
# define HB_GC_LOCK
|
||||
# define HB_GC_UNLOCK
|
||||
# define HB_GC_LOCK() do {} while( 0 )
|
||||
# define HB_GC_UNLOCK() do {} while( 0 )
|
||||
|
||||
#endif /* HB_MT_VM */
|
||||
|
||||
@@ -141,11 +141,11 @@ static HB_PTRUINT s_ulBlocksAuto = 0;
|
||||
/* number of allocated memory blocks which should force next GC activation */
|
||||
static HB_PTRUINT s_ulBlocksCheck = 0;
|
||||
|
||||
# define HB_GC_AUTO_INC ++s_ulBlocks;
|
||||
# define HB_GC_AUTO_DEC --s_ulBlocks;
|
||||
# define HB_GC_AUTO_INC() ++s_ulBlocks
|
||||
# define HB_GC_AUTO_DEC() --s_ulBlocks
|
||||
#else
|
||||
# define HB_GC_AUTO_INC
|
||||
# define HB_GC_AUTO_DEC
|
||||
# define HB_GC_AUTO_INC() do {} while( 0 )
|
||||
# define HB_GC_AUTO_DEC() do {} while( 0 )
|
||||
#endif
|
||||
|
||||
/* pointer to memory block that will be checked in next step */
|
||||
@@ -204,9 +204,9 @@ void * hb_gcAllocate( HB_SIZE nSize, const HB_GC_FUNCS * pFuncs )
|
||||
pAlloc->pFuncs = pFuncs;
|
||||
pAlloc->locked = 1;
|
||||
pAlloc->used = s_uUsedFlag;
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
hb_gcLink( &s_pLockedBlock, pAlloc );
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
return HB_BLOCK_PTR( pAlloc ); /* hide the internal data */
|
||||
}
|
||||
@@ -221,19 +221,19 @@ void * hb_gcAllocRaw( HB_SIZE nSize, const HB_GC_FUNCS * pFuncs )
|
||||
pAlloc->locked = 0;
|
||||
pAlloc->used = s_uUsedFlag;
|
||||
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
#ifdef HB_GC_AUTO
|
||||
if( s_ulBlocks > s_ulBlocksCheck )
|
||||
{
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
hb_gcCollectAll( HB_TRUE );
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
pAlloc->used = s_uUsedFlag;
|
||||
}
|
||||
HB_GC_AUTO_INC
|
||||
HB_GC_AUTO_INC();
|
||||
#endif
|
||||
hb_gcLink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
return HB_BLOCK_PTR( pAlloc ); /* hide the internal data */
|
||||
}
|
||||
@@ -248,15 +248,15 @@ void hb_gcFree( void * pBlock )
|
||||
/* Don't release the block that will be deleted during finalization */
|
||||
if( ! ( pAlloc->used & HB_GC_DELETE ) )
|
||||
{
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
if( pAlloc->locked )
|
||||
hb_gcUnlink( &s_pLockedBlock, pAlloc );
|
||||
else
|
||||
{
|
||||
hb_gcUnlink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_AUTO_DEC
|
||||
HB_GC_AUTO_DEC();
|
||||
}
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
HB_GARBAGE_FREE( pAlloc );
|
||||
}
|
||||
@@ -296,15 +296,15 @@ void hb_gcRefFree( void * pBlock )
|
||||
/* unlink the block first to avoid possible problems
|
||||
* if cleanup function activate GC
|
||||
*/
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
if( pAlloc->locked )
|
||||
hb_gcUnlink( &s_pLockedBlock, pAlloc );
|
||||
else
|
||||
{
|
||||
hb_gcUnlink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_AUTO_DEC
|
||||
HB_GC_AUTO_DEC();
|
||||
}
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
pAlloc->used |= HB_GC_DELETE;
|
||||
|
||||
@@ -345,10 +345,10 @@ void hb_gcRefCheck( void * pBlock )
|
||||
pAlloc->used = s_uUsedFlag;
|
||||
pAlloc->locked = 0;
|
||||
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
hb_gcLink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_AUTO_INC
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_AUTO_INC();
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
if( hb_vmRequestQuery() == 0 )
|
||||
hb_errRT_BASE( EG_DESTRUCTOR, 1301, NULL, "Reference to freed block", 0 );
|
||||
@@ -390,9 +390,9 @@ PHB_ITEM hb_gcGripGet( PHB_ITEM pOrigin )
|
||||
|
||||
pItem->type = HB_IT_NIL;
|
||||
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
hb_gcLink( &s_pLockedBlock, pAlloc );
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
if( pOrigin )
|
||||
hb_itemCopy( pItem, pOrigin );
|
||||
@@ -414,15 +414,15 @@ void * hb_gcLock( void * pBlock )
|
||||
{
|
||||
HB_GARBAGE_PTR pAlloc = HB_GC_PTR( pBlock );
|
||||
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
if( ! pAlloc->locked )
|
||||
{
|
||||
hb_gcUnlink( &s_pCurrBlock, pAlloc );
|
||||
hb_gcLink( &s_pLockedBlock, pAlloc );
|
||||
HB_GC_AUTO_DEC
|
||||
HB_GC_AUTO_DEC();
|
||||
}
|
||||
++pAlloc->locked;
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
}
|
||||
|
||||
return pBlock;
|
||||
@@ -439,7 +439,7 @@ void * hb_gcUnlock( void * pBlock )
|
||||
|
||||
if( pAlloc->locked )
|
||||
{
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
if( pAlloc->locked )
|
||||
{
|
||||
if( --pAlloc->locked == 0 )
|
||||
@@ -448,10 +448,10 @@ void * hb_gcUnlock( void * pBlock )
|
||||
|
||||
hb_gcUnlink( &s_pLockedBlock, pAlloc );
|
||||
hb_gcLink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_AUTO_INC
|
||||
HB_GC_AUTO_INC();
|
||||
}
|
||||
}
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
}
|
||||
}
|
||||
return pBlock;
|
||||
@@ -463,7 +463,7 @@ void hb_gcAttach( void * pBlock )
|
||||
|
||||
if( pAlloc->locked )
|
||||
{
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
if( pAlloc->locked )
|
||||
{
|
||||
if( --pAlloc->locked == 0 )
|
||||
@@ -472,11 +472,11 @@ void hb_gcAttach( void * pBlock )
|
||||
|
||||
hb_gcUnlink( &s_pLockedBlock, pAlloc );
|
||||
hb_gcLink( &s_pCurrBlock, pAlloc );
|
||||
HB_GC_AUTO_INC
|
||||
HB_GC_AUTO_INC();
|
||||
pAlloc = NULL;
|
||||
}
|
||||
}
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
}
|
||||
if( pAlloc )
|
||||
hb_xRefInc( pAlloc );
|
||||
@@ -659,7 +659,7 @@ void hb_gcCollectAll( HB_BOOL fForce )
|
||||
pDelete->used |= HB_GC_DELETE | HB_GC_DELETELST;
|
||||
hb_gcUnlink( &s_pCurrBlock, pDelete );
|
||||
hb_gcLink( &s_pDeletedBlock, pDelete );
|
||||
HB_GC_AUTO_DEC
|
||||
HB_GC_AUTO_DEC();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -720,10 +720,10 @@ void hb_gcCollectAll( HB_BOOL fForce )
|
||||
{
|
||||
pDelete->used = s_uUsedFlag;
|
||||
pDelete->locked = 0;
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
hb_gcLink( &s_pCurrBlock, pDelete );
|
||||
HB_GC_AUTO_INC
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_AUTO_INC();
|
||||
HB_GC_UNLOCK();
|
||||
if( hb_vmRequestQuery() == 0 )
|
||||
hb_errRT_BASE( EG_DESTRUCTOR, 1301, NULL, "Reference to freed block", 0 );
|
||||
}
|
||||
@@ -767,7 +767,7 @@ void hb_gcReleaseAll( void )
|
||||
HB_TRACE( HB_TR_INFO, ( "Release %p", s_pCurrBlock ) );
|
||||
pDelete = s_pCurrBlock;
|
||||
hb_gcUnlink( &s_pCurrBlock, pDelete );
|
||||
HB_GC_AUTO_DEC
|
||||
HB_GC_AUTO_DEC();
|
||||
HB_GARBAGE_FREE( pDelete );
|
||||
|
||||
}
|
||||
@@ -814,7 +814,7 @@ HB_FUNC( HB_GCSETAUTO )
|
||||
|
||||
nBlocks = fSet ? hb_parnint( 1 ) * 1000 : 0;
|
||||
|
||||
HB_GC_LOCK
|
||||
HB_GC_LOCK();
|
||||
nPrevBlocks = s_ulBlocksAuto;
|
||||
if( fSet )
|
||||
{
|
||||
@@ -828,7 +828,7 @@ HB_FUNC( HB_GCSETAUTO )
|
||||
s_ulBlocksCheck = HB_GC_AUTO_MAX;
|
||||
}
|
||||
}
|
||||
HB_GC_UNLOCK
|
||||
HB_GC_UNLOCK();
|
||||
|
||||
hb_retnint( nPrevBlocks / 1000 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user