Changeset 9266 for trunk/src


Ignore:
Timestamp:
Sep 19, 2002, 11:38:27 AM (23 years ago)
Author:
sandervl
Message:

include new & delete in memory statistics

Location:
trunk/src/odincrt
Files:
2 edited

Legend:

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

    r7627 r9266  
    1 /* $Id: malloc.cpp,v 1.6 2001-12-13 15:32:17 sandervl Exp $ */
     1/* $Id: malloc.cpp,v 1.7 2002-09-19 09:38:26 sandervl Exp $ */
    22/*
    33 * Project Odin Software License can be found in LICENSE.TXT
     
    3333    *ptotalmemalloc  = totalmemalloc;
    3434}
     35
     36void __cdecl new_alloc(int size)
     37{
     38    nrcalls_malloc++;
     39    totalmemalloc += size;
     40}
     41
     42void __cdecl delete_free(void *ptr)
     43{
     44    nrcalls_free++;
     45    totalmemalloc -= _msize(ptr);
     46}
     47
    3548#endif
    3649
  • trunk/src/odincrt/odincrt.asm

    r1925 r9266  
    1 ; $Id: odincrt.asm,v 1.3 1999-12-01 18:41:46 sandervl Exp $
     1; $Id: odincrt.asm,v 1.4 2002-09-19 09:38:27 sandervl Exp $
    22
    33;/*
     
    1717                ASSUME  DS:FLAT, SS:FLAT
    1818
     19IFDEF DEBUG
     20                EXTRN _delete_free:NEAR
     21                EXTRN _new_alloc:NEAR
     22ENDIF
    1923                PUBLIC  __threadid
    2024__threadid proc near
     
    4347        mov     fs, ax
    4448        pop     eax
     49IFDEF DEBUG
     50        pushad
     51        push    eax
     52        call    _new_alloc
     53        add     esp, 4
     54        popad
     55ENDIF
    4556        sub     esp, 0Ch
    4657        call    __nw__FUiPCcT1
     
    6172        mov     fs, ax
    6273        pop     eax
     74IFDEF DEBUG
     75        pushad
     76        push    eax
     77        call    _delete_free
     78        add     esp, 4
     79        popad
     80ENDIF
    6381        sub     esp, 0Ch
    6482        call    __dl__FPvPCcUi
Note: See TracChangeset for help on using the changeset viewer.