pike.git/
src/
svalue.h
Branch:
Tag:
Non-build tags
All tags
No tags
2003-03-14
2003-03-14 15:43:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>
24bce645b5104ed0e0e74355afd4d16f6d211ed8 (
16
lines) (+
9
/-
7
)
[
Show
|
Annotate
]
Branch:
7.9
Added DMALLOC_NAMED_LOCATION().
Rev: src/dmalloc.h:1.44
Rev: src/svalue.h:1.117
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: svalue.h,v 1.
116
2003/
02
/
16
03
:
59
:
58
mast
Exp $
+
|| $Id: svalue.h,v 1.
117
2003/
03
/
14
15
:
43
:
22
grubba
Exp $
*/ #ifndef SVALUE_H
371:
#undef sub_ref #ifdef PIKE_RUN_UNLOCKED
-
#define add_ref(X) pike_atomic_inc32((INT32 *)debug_malloc_
pass
( &((X)->refs)))
-
#define sub_ref(X) pike_atomic_dec_and_test32((INT32 *)debug_malloc_
pass
( &((X)->refs)))
+
#define add_ref(X) pike_atomic_inc32((INT32 *)debug_malloc_
update_location
( &((X)->refs)
, DMALLOC_NAMED_LOCATION(" add_ref"
))
)
+
#define sub_ref(X) pike_atomic_dec_and_test32((INT32 *)debug_malloc_
update_location
( &((X)->refs)
, DMALLOC_NAMED_LOCATION(" sub_ref"
))
)
#else
-
#define add_ref(X) (((INT32 *)debug_malloc_
pass
( &((X)->refs)))[0]++)
-
#define sub_ref(X) (--((INT32 *)debug_malloc_
pass
( &((X)->refs)))[0] > 0)
+
#define add_ref(X) (((INT32 *)debug_malloc_
update_location
( &((X)->refs)
, DMALLOC_NAMED_LOCATION(" add_ref"
))
)
[0]++)
+
#define sub_ref(X) (--((INT32 *)debug_malloc_
update_location
( &((X)->refs)
, DMALLOC_NAMED_LOCATION(" sub_ref"
))
)
[0] > 0)
#endif
485:
}while(0); #ifdef DEBUG_MALLOC
-
#define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z), DMALLOC_LOCATION());
+
#define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z), DMALLOC_
NAMED_
LOCATION(
" free_svalues"
));
#else #define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z)); #endif
758:
#define INIT_PIKE_MEMOBJ(X) do { \ struct ref_dummy *v_=(struct ref_dummy *)(X); \
-
v_->refs=
1
; \
+
v_->refs=
0
; \
+
add_ref(v_); /* For DMALLOC... */ \
DO_IF_SECURITY( INITIALIZE_PROT(v_) ); \ IF_LOCAL_MUTEX(mt_init_recursive(&(v_->mutex))); \ }while(0)