Changeset 8880 for trunk/src


Ignore:
Timestamp:
Jul 15, 2002, 4:40:16 PM (23 years ago)
Author:
sandervl
Message:

Dynamically allocate handlemanager array to prevent waste of shared memory (as it is a private array (for now))

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/HandleManager.cpp

    r8401 r8880  
    1 /* $Id: HandleManager.cpp,v 1.88 2002-05-10 14:55:09 sandervl Exp $ */
     1/* $Id: HandleManager.cpp,v 1.89 2002-07-15 14:40:15 sandervl Exp $ */
    22
    33/*
     
    121121static PHMDEVICE TabWin32Devices = NULL;
    122122
    123 static HMHANDLE TabWin32Handles[MAX_OS2_HMHANDLES];   /* static handle table */
    124 VMutex          handleMutex;
     123static HMHANDLE *TabWin32Handles = NULL;   /* static handle table */
     124VMutex           handleMutex;
    125125
    126126struct _HMGlobals
     
    420420  {
    421421    handleMutex.enter();
     422
     423    TabWin32Handles = (HMHANDLE *)malloc(MAX_OS2_HMHANDLES*sizeof(HMHANDLE));
     424    if(TabWin32Handles == NULL) {
     425        DebugInt3();
     426        return ERROR_NOT_ENOUGH_MEMORY;
     427    }
     428    memset(TabWin32Handles, 0, MAX_OS2_HMHANDLES*sizeof(HMHANDLE));
     429
    422430    // fill handle table
    423431    for(ulIndex = 0; ulIndex < MAX_OS2_HMHANDLES; ulIndex++) {
  • trunk/src/kernel32/initkernel32.cpp

    r8863 r8880  
    1 /* $Id: initkernel32.cpp,v 1.20 2002-07-13 15:57:57 sandervl Exp $
     1/* $Id: initkernel32.cpp,v 1.21 2002-07-15 14:40:16 sandervl Exp $
    22 *
    33 * KERNEL32 DLL entry point
     
    140140                return 0UL;
    141141
     142            //SvL: Do it here instead of during the exe object creation
     143            //(std handles can be used in win32 dll initialization routines
     144            HMInitialize();             /* store standard handles within HandleManager */
     145
    142146            InitializeMemMaps();
    143147
     
    173177            OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES);
    174178
    175             //SvL: Do it here instead of during the exe object creation
    176             //(std handles can be used in win32 dll initialization routines
    177             HMInitialize();             /* store standard handles within HandleManager */
    178179            InitDirectories();          //Must be done before InitializeTIB (which loads NTDLL -> USER32)
    179180            InitializeMainThread();     //Must be done after HMInitialize!
Note: See TracChangeset for help on using the changeset viewer.