Changeset 22274 for v6

Show
Ignore:
Timestamp:
09/18/08 12:02:00 (2 months ago)
Author:
pmurias
Message:

[smop] SMOP_RELEASE and SMOP_REFERENCE print line,function and file with SMOP_LOWLEVEL_MEM_DEBUG

Location:
v6/smop
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/CMakeLists.txt

    r22272 r22274  
    11project (smop) 
    2 SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_TRACE" ) 
     2SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_DEBUG -DSMOP_LOWLEVEL_MEM_TRACE" ) 
    33SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) 
    44cmake_minimum_required (VERSION 2.6) 
  • v6/smop/include/smop_base.h

    r22017 r22274  
    1  
     1#include <stdio.h> 
    22#ifndef SMOP_BASE_H 
    33#define SMOP_BASE_H 
     
    8383      )) 
    8484 
     85#ifdef SMOP_LOWLEVEL_MEM_DEBUG 
     86#define SMOP_REFERENCE(interpreter, object) \ 
     87      (fprintf(stderr,"SMOP_REFERENCE(%p) at %s line %d file %s\n",object,__func__,__LINE__,__FILE__),\ 
     88      (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->REFERENCE( (SMOP__Object*)interpreter, \ 
     89          ((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object)), \ 
     90          (SMOP__Object*)object \ 
     91      ))) 
     92 
     93#define SMOP_RELEASE(interpreter, object) \ 
     94      (fprintf(stderr,"SMOP_RELEASE(%p) at %s line %d file %s\n",object,__func__,__LINE__,__FILE__), \ 
     95      (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->RELEASE( (SMOP__Object*)interpreter, \ 
     96          ((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object)), \ 
     97          (SMOP__Object*)object \ 
     98      ))) 
     99#else 
    85100#define SMOP_REFERENCE(interpreter, object) \ 
    86101      (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->REFERENCE( (SMOP__Object*)interpreter, \ 
     
    88103          (SMOP__Object*)object \ 
    89104      )) 
    90  
    91105#define SMOP_RELEASE(interpreter, object) \ 
    92106      (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->RELEASE( (SMOP__Object*)interpreter, \ 
     
    94108          (SMOP__Object*)object \ 
    95109      )) 
     110#endif 
    96111 
    97112 
  • v6/smop/src/smop_s1p_io.ri

    r22270 r22274  
    3131            printf("%.*s",len,str); 
    3232        } else { 
    33             fprintf(stderr,"unsupported object (%s) passed to S1P::IO.print\n",SMOP_RI(obj)->id); 
     33            printf("unsupported object %p (%s) passed to S1P::IO.print\n",obj,SMOP_RI(obj)->id); 
    3434        } 
    3535