Changeset 2182 for trunk/src


Ignore:
Timestamp:
Dec 21, 1999, 2:46:25 PM (26 years ago)
Author:
sandervl
Message:

calloc bugfix + private heap for crtldll added

Location:
trunk/src/crtdll
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crtdll/crt.cpp

    r2177 r2182  
    1 /* $Id: crt.cpp,v 1.1 1999-12-21 12:27:11 sandervl Exp $ */
     1/* $Id: crt.cpp,v 1.2 1999-12-21 13:46:24 sandervl Exp $ */
    22
    33/*
     
    471471  va_list argptr;                          /* -> variable argument list */
    472472
    473   dprintf(("CRTDLL: sprintf(%08xh,%s)\n",
    474            lpstrBuffer,
    475            lpstrFormat));
     473//  dprintf(("CRTDLL: sprintf(%08xh,%s)\n",
     474//           lpstrBuffer,
     475//          lpstrFormat));
    476476
    477477  va_start(argptr,
     
    569569                      const LPSTR str2)
    570570{
    571   dprintf(("CRTDLL: _stricmp(%s,%s)\n",
    572            str1,
    573            str2));
     571//  dprintf(("CRTDLL: _stricmp(%s,%s)\n",
     572//           str1,
     573//           str2));
    574574
    575575  return (stricmp(str1, str2));
     
    592592                       const LPSTR str2)
    593593{
    594   dprintf(("CRTDLL: strcpy\n"));
     594//  dprintf(("CRTDLL: strcpy\n"));
    595595
    596596  return (strcpy(str1, str2));
     
    613613                                LPSTR str2)
    614614{
    615   dprintf(("CRTDLL: strcspn(%s,%s)\n",
    616            str1,
    617            str2));
     615//  dprintf(("CRTDLL: strcspn(%s,%s)\n",
     616//           str1,
     617//           str2));
    618618
    619619  return (strcspn(str1, str2));
     
    635635size_t CDECL CRTDLL_strlen(const LPSTR str)
    636636{
    637   dprintf(("CRTDLL: strlen(%s)\n",
    638            str));
     637//  dprintf(("CRTDLL: strlen(%s)\n",
     638//           str));
    639639
    640640  return (strlen(str));
     
    658658                        size_t      i)
    659659{
    660   dprintf(("CRTDLL: strncat(%s,%s,%08xh)\n",
    661            str1,
    662            str2,
    663            i));
     660//  dprintf(("CRTDLL: strncat(%s,%s,%08xh)\n",
     661//           str1,
     662//           str2,
     663//           i));
    664664
    665665  return (strncat(str1, str2, i));
     
    683683                       size_t      i)
    684684{
    685   dprintf(("CRTDLL: strncmp(%s,%s,%08xh)\n",
    686            str1,
    687            str2,
    688            i));
     685//  dprintf(("CRTDLL: strncmp(%s,%s,%08xh)\n",
     686//           str1,
     687//           str2,
     688//           i));
    689689
    690690  return (strncmp(str1, str2, i));
     
    708708                        size_t      i)
    709709{
    710   dprintf(("CRTDLL: strncpy(%s,%s,%08xh)\n",
    711            str1,
    712            str2,
    713            i));
     710//  dprintf(("CRTDLL: strncpy(%s,%s,%08xh)\n",
     711//           str1,
     712//           str2,
     713//           i));
    714714
    715715  return (strncpy(str1, str2, i));
     
    801801                       const LPSTR str2)
    802802{
    803   dprintf(("CRTDLL: strstr(%s,%s)\n",
    804            str1,
    805            str2));
     803//  dprintf(("CRTDLL: strstr(%s,%s)\n",
     804//           str1,
     805//           str2));
    806806
    807807  return (strstr(str1, str2));
     
    829829  int     rc;
    830830
    831   dprintf(("CRTDLL: swprintf(%s,%d,%s)\n",
    832            str,
    833            i,
    834            format));
     831//  dprintf(("CRTDLL: swprintf(%s,%d,%s)\n",
     832//           str,
     833//           i,
     834//           format));
    835835
    836836  va_start( valist, format );
  • trunk/src/crtdll/crtdll.cpp

    r2177 r2182  
    1 /* $Id: crtdll.cpp,v 1.17 1999-12-21 12:27:11 sandervl Exp $ */
     1/* $Id: crtdll.cpp,v 1.18 1999-12-21 13:46:24 sandervl Exp $ */
    22
    33/*
     
    5353DEFAULT_DEBUG_CHANNEL(crtdll)
    5454
     55//SvL: per process heap for CRTDLL
     56HANDLE CRTDLL_hHeap = 0;
     57
    5558
    5659/*********************************************************************
     
    6366                CRTDLL__fdopen(1,"w");
    6467                CRTDLL__fdopen(2,"w");
     68                CRTDLL_hHeap = HeapCreate(0, 0x10000, 0);
    6569        }
     70        else
     71        if (fdwReason == DLL_PROCESS_DETACH) {
     72                HeapDestroy(CRTDLL_hHeap);
     73                CRTDLL_hHeap = 0;
     74        }       
    6675        return TRUE;
    6776}
     
    7584    dprintf(("CRTDLL: ??2@YAPAXI@Z\n"));
    7685    VOID* result;
    77     if(!(result = HeapAlloc(GetProcessHeap(),0,size)) && new_handler)
     86    if(!(result = Heap_Alloc(size)) && new_handler)
    7887        (*new_handler)();
    7988    return result;
     
    8796{
    8897    dprintf(("CRTDLL: ??3@YAXPAX@Z\n"));
    89     HeapFree(GetProcessHeap(),0,ptr);
     98    Heap_Free(ptr);
    9099}
    91100
     
    10471056        break;
    10481057    default:
    1049         file = (PCRTDLL_FILE)HeapAlloc( GetProcessHeap(), 0, sizeof(*file) );
     1058        file = (PCRTDLL_FILE)Heap_Alloc(sizeof(*file) );
    10501059        file->handle = handle;
    10511060        break;
     
    34873496int CDECL CRTDLL__setjmp( jmp_buf env )
    34883497{
    3489   dprintf(("CRTDLL: _setjmp -> setjmp\n"));
     3498  dprintf(("CRTDLL: _setjmp -> setjmp (NOT IDENTICAL!!!)\n"));
     3499  return(setjmp( env));
     3500}
     3501
     3502/*********************************************************************
     3503 *           CRTDLL__setjmp3     (CRTDLL.262)
     3504 */
     3505int CDECL CRTDLL__setjmp3( jmp_buf env )
     3506{
     3507  dprintf(("CRTDLL: _setjmp3 -> setjmp (NOT IDENTICAL!!!)\n"));
    34903508  return(setjmp( env));
    34913509}
     
    41924210void * CDECL CRTDLL_calloc( size_t n, size_t size )
    41934211{
    4194   dprintf(("CRTDLL: calloc\n"));
    4195   return (calloc(n, size));
     4212//  dprintf(("CRTDLL: calloc\n"));
     4213  return Heap_Alloc(size*n);
    41964214}
    41974215
     
    44284446size_t CDECL CRTDLL_fread( void *ptr, size_t size, size_t n, FILE *fp )
    44294447{
    4430   dprintf(("CRTDLL: fread\n"));
     4448//  dprintf(("CRTDLL: fread\n"));
    44314449  return (fread(ptr, size, n, fp));
    44324450}
     
    44384456VOID CDECL CRTDLL_free(LPVOID ptr)
    44394457{
    4440     dprintf(("CRTDLL: free\n"));
    4441     HeapFree(GetProcessHeap(),0,ptr);
     4458//    dprintf(("CRTDLL: free\n"));
     4459    Heap_Free(ptr);
    44424460}
    44434461
     
    48454863VOID* CDECL CRTDLL_malloc(DWORD size)
    48464864{
    4847       dprintf(("CRTDLL: malloc\n"));
    4848       return HeapAlloc(GetProcessHeap(),0,size);
     4865//      dprintf(("CRTDLL: malloc\n"));
     4866      return Heap_Alloc(size);
    48494867}
    48504868
  • trunk/src/crtdll/crtdll.def

    r2177 r2182  
    1 ; $Id: crtdll.def,v 1.10 1999-12-21 12:27:12 sandervl Exp $
     1; $Id: crtdll.def,v 1.11 1999-12-21 13:46:25 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    539539
    540540    _itow                       = _CRTDLL__itow                 @600
     541    _setjmp3                    = _CRTDLL__setjmp3              @601
  • trunk/src/crtdll/crtinc.h

    r2177 r2182  
    1 /* $Id: crtinc.h,v 1.12 1999-12-21 12:27:12 sandervl Exp $ */
     1/* $Id: crtinc.h,v 1.13 1999-12-21 13:46:25 sandervl Exp $ */
    22
    33/* Definitions for the CRTDLL library (CRTDLL.DLL)
     
    1010#define MAX_PATHNAME_LEN 260
    1111#endif
     12
     13//SvL: Internal heap allocation definitions for NTDLL
     14extern HANDLE CRTDLL_hHeap;
     15#define Heap_Alloc(a)   HeapAlloc(CRTDLL_hHeap, HEAP_ZERO_MEMORY, a)
     16#define Heap_Free(a)    HeapFree(CRTDLL_hHeap, 0, (PVOID)a)
    1217
    1318// MBC Defs
Note: See TracChangeset for help on using the changeset viewer.