Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/kernel32/heapshared.cpp

    r21302 r21916  
    88 *
    99 * TODO: Not process/thread safe (initializing/destroying heap)
    10  * 
     10 *
    1111 * ASSUMPTION: Rtl library takes care of protection of heap increase/decrease
    1212 *             (from multiple threads/processes)
     
    3131#include "dbglocal.h"
    3232
    33 #define MAX_HEAPSIZE            (2048*1024)
     33#define MAX_HEAPSIZE        (2048*1024)
    3434#define MAX_HEAPPAGES           (MAX_HEAPSIZE/PAGE_SIZE)
    3535#define INCR_HEAPSIZE           (16*1024)
    3636
    37 //Global DLL Data
    38 #pragma data_seg(_GLOBALDATA)
    39        Heap_t  sharedHeap = 0;
    40 static PVOID   pSharedMem = NULL;
    41 static BYTE    pageBitmap[MAX_HEAPPAGES] = {0};
    42 static ULONG   refCount = 0;
    43 #pragma data_seg()
     37//
     38// Global DLL Data (keep it in sync with globaldata.asm!)
     39//
     40extern Heap_t  sharedHeap; // = 0
     41extern PVOID   pSharedMem; // = NULL
     42extern BYTE    pageBitmap[MAX_HEAPPAGES]; // = {0}
     43extern ULONG   refCount; // = 0;
    4444
    4545static int     privateRefCount = 0;
     
    158158    dprintf(("KERNEL32: GetPageRangeFree(%08xh)", pageoffset));
    159159
    160     for(int i=pageoffset;i<MAX_HEAPPAGES;i++) {
     160    int i;
     161    for(i=pageoffset;i<MAX_HEAPPAGES;i++) {
    161162        if(pageBitmap[i] == 1) {
    162163                    break;
     
    184185    {
    185186        int nrpagesfree = GetPageRangeFree(i);
    186         if(nrpagesfree >= *size/PAGE_SIZE) 
     187        if(nrpagesfree >= *size/PAGE_SIZE)
    187188        {
    188189                    newblock = (PVOID)((ULONG)pSharedMem + i*PAGE_SIZE);
     
    254255//******************************************************************************
    255256//******************************************************************************
    256 void * _System _debug_smalloc(int size, char *pszFile, int linenr)
     257void * _System _debug_smalloc(int size, const char *pszFile, int linenr)
    257258{
    258259    void *chunk;
     
    268269//******************************************************************************
    269270//******************************************************************************
    270 void * _System _debug_smallocfill(int size, int filler, char *pszFile, int linenr)
     271void * _System _debug_smallocfill(int size, int filler, const char *pszFile, int linenr)
    271272{
    272273    void *chunk;
     
    285286//******************************************************************************
    286287//******************************************************************************
    287 void   _System _debug_sfree(void *chunk, char *pszFile, int linenr)
     288void   _System _debug_sfree(void *chunk, const char *pszFile, int linenr)
    288289{
    289290    dprintf(("_sfree %x", chunk));
Note: See TracChangeset for help on using the changeset viewer.