2016-01-14 11:02 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* config/global.mk
    * set HARBOUR=F:100 during build process in OS2 builds - it increases
      maximum number of open handles per process from 20 to 100 so it should
      be possible to use -j<n> switch during Harbour compilation - please
      test, i.e.:
         os2-make -j3

  * contrib/xhb/hbcompat.ch
    ! fixed pp rules for Str(,,, <lStrip> ) translation

  * include/hbapifs.h
  * src/rtl/filesys.c
    + added new C function:
         HB_FHANDLE hb_fsOpenEx( const char * pszFileName, HB_FATTR nAttr,
                                 HB_USHORT uiFlags );
    * minor cleanup

  * include/hbmemory.ch
  * src/vm/fm.c
    + added two new actions for Memory() function:
         HB_MEM_STATISTICS - return non 0 value if FM statistic is enabled
         HB_MEM_ISLIMIT    - return non 0 value if used memory limit is
                             supported
    + added new PRG function:
         __fm_allocLimit( [ <nNewLimit> ] ) -> <nPrevLimit>
      It allows to set limit for maximum used memory in some memory
      managers, -1 means no limit.
      Now it works with DLMALLOC and in ST mode it's limit for memory
      allocated from system for whole application. In MT mode when
      HB_FM_DLMT_ALLOC (default for DLMALLOC) is enabled it's limit for
      single MSPACE (Harbour allocates 16 MSPACES and balance them
      between threads to improve scalability) so it's rather per thread
      limit. If memory statistic module is enabled during Harbour build
      process then this limit works with any memory manager and defines
      limit for total memory allocated by Harbour application regardles
      of MT or ST mode.

  * src/vm/hvm.c
    * use HB_MEM_STATISTICS instead of HB_MEM_USEDMAX to check if memory
      statistic module is enabled
This commit is contained in:
Przemysław Czerpak
2016-01-14 11:02:51 +01:00
parent ca9bb39a23
commit 04283dd94f
8 changed files with 153 additions and 14 deletions

View File

@@ -153,6 +153,7 @@ extern HB_EXPORT int hb_fsLockTest ( HB_FHANDLE hFileHandle, HB_FOFFSE
HB_FOFFSET nLength, HB_USHORT uiMode );
extern HB_EXPORT HB_BOOL hb_fsMkDir ( const char * pszDirName ); /* create a directory */
extern HB_EXPORT HB_FHANDLE hb_fsOpen ( const char * pszFileName, HB_USHORT uiFlags ); /* open a file */
extern HB_EXPORT HB_FHANDLE hb_fsOpenEx ( const char * pszFileName, HB_FATTR nAttr, HB_USHORT uiFlags ); /* open or new create a file with given attributes */
extern HB_EXPORT HB_USHORT hb_fsRead ( HB_FHANDLE hFileHandle, void * pBuff, HB_USHORT uiCount ); /* read contents of a file into a buffer (<=64K) */
extern HB_EXPORT HB_SIZE hb_fsReadLarge ( HB_FHANDLE hFileHandle, void * pBuff, HB_SIZE nCount ); /* read contents of a file into a buffer (>64K) */
extern HB_EXPORT HB_SIZE hb_fsReadAt ( HB_FHANDLE hFileHandle, void * pBuff, HB_SIZE nCount, HB_FOFFSET nOffset ); /* read from given offset contents of a file into a buffer (>64K) */

View File

@@ -74,5 +74,6 @@
#define HB_MEM_STACK 1004 /* Total memory size used by the stack (bytes) */
#define HB_MEM_STACK_TOP 1005 /* Total items currently on the stack */
#define HB_MEM_BLOCKS 1007 /* Total number of memory blocks allocated */
#define HB_MEM_STATISTICS 1008 /* Return non 0 value if FM statistic is enabled */
#define HB_MEM_ISLIMIT 1009 /* Return non 0 value if used memory limit is supported */
#endif /* HB_MEMORY_CH_ */