Ignore:
Timestamp:
Dec 6, 1999, 7:09:13 PM (26 years ago)
Author:
dengert
Message:

set returned memory to zero for debug functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/odincrt/malloc.cpp

    r1906 r1991  
    1 /* $Id: malloc.cpp,v 1.3 1999-12-01 00:12:26 sandervl Exp $ */
     1/* $Id: malloc.cpp,v 1.4 1999-12-06 18:09:13 dengert Exp $ */
    22/*
    33 * Project Odin Software License can be found in LICENSE.TXT
     
    2222void * _LNK_CONV os2calloc( size_t a, size_t b )
    2323{
    24     unsigned short sel = RestoreOS2FS(); 
     24    unsigned short sel = RestoreOS2FS();
    2525    void *rc;
    2626
     
    3232void   _LNK_CONV os2free( void *a )
    3333{
    34     unsigned short sel = RestoreOS2FS(); 
     34    unsigned short sel = RestoreOS2FS();
    3535
    36         free(a);
     36        free(a);
    3737        SetFS(sel);
    3838}
     
    4040void * _LNK_CONV os2malloc( size_t a)
    4141{
    42     unsigned short sel = RestoreOS2FS(); 
     42    unsigned short sel = RestoreOS2FS();
    4343    void *rc;
    4444
     
    5050void * _LNK_CONV os2realloc( void *a, size_t b)
    5151{
    52     unsigned short sel = RestoreOS2FS(); 
     52    unsigned short sel = RestoreOS2FS();
    5353    void *rc;
    5454
     
    6060void * _LNK_CONV os2_debug_calloc( size_t a, size_t b, const char *c, size_t d)
    6161{
    62     unsigned short sel = RestoreOS2FS(); 
     62    unsigned short sel = RestoreOS2FS();
    6363    void *rc;
    6464
     
    7070void   _LNK_CONV os2_debug_free( void *a, const char *b, size_t c)
    7171{
    72     unsigned short sel = RestoreOS2FS(); 
     72    unsigned short sel = RestoreOS2FS();
    7373
    7474        _debug_free(a,b,c);
     
    7878void * _LNK_CONV os2_debug_malloc( size_t a, const char *b, size_t c)
    7979{
    80     unsigned short sel = RestoreOS2FS(); 
     80    unsigned short sel = RestoreOS2FS();
    8181    void *rc;
    8282
    83         rc = _debug_malloc(a,b,c);
     83        rc = _debug_calloc(1,a,b,c);
    8484        SetFS(sel);
    8585        return rc;
     
    8888void * _LNK_CONV os2_debug_realloc( void *a, size_t b, const char *c, size_t d)
    8989{
    90     unsigned short sel = RestoreOS2FS(); 
     90    unsigned short sel = RestoreOS2FS();
    9191    void *rc;
    9292
     
    9898void * _LNK_CONV os2_umalloc(Heap_t a, size_t b)
    9999{
    100     unsigned short sel = RestoreOS2FS(); 
     100    unsigned short sel = RestoreOS2FS();
    101101    void *rc;
    102102
     
    108108void * _LNK_CONV os2_ucalloc(Heap_t a, size_t b, size_t c)
    109109{
    110     unsigned short sel = RestoreOS2FS(); 
     110    unsigned short sel = RestoreOS2FS();
    111111    void *rc;
    112112
     
    118118void * _LNK_CONV os2_debug_umalloc(Heap_t a, size_t b, const char *c, size_t d)
    119119{
    120     unsigned short sel = RestoreOS2FS(); 
     120    unsigned short sel = RestoreOS2FS();
    121121    void *rc;
    122122
    123         rc = _debug_umalloc(a,b,c,d);
     123        rc = _debug_ucalloc(a, 1, b,c,d);
    124124        SetFS(sel);
    125125        return rc;
     
    128128void * _LNK_CONV os2_debug_ucalloc(Heap_t a, size_t b, size_t c, const char *d, size_t e)
    129129{
    130     unsigned short sel = RestoreOS2FS(); 
     130    unsigned short sel = RestoreOS2FS();
    131131    void *rc;
    132132
Note: See TracChangeset for help on using the changeset viewer.