diff --git a/src/acconfig.h b/src/acconfig.h index c9eb79e0c4c770e208dd8efca97938d79d4faef9..4e34427e9e20fb4ca5c4f12776e8e810fce26d5e 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -67,9 +67,6 @@ /* With this, dmalloc will report leaks made by malloc(3) calls */ #undef REPORT_ENCAPSULATED_MALLOC -/* Define this to enable atomic svalues */ -#undef ATOMIC_SVALUE - /* Define this to enable the internal Pike security system */ #undef PIKE_SECURITY diff --git a/src/configure.in b/src/configure.in index 0aca2ac9d608801a6eaccbcc7a68d9d2a73c0e80..9665731a6d61d71b9fc9bcab17663f3019c650eb 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1553,13 +1553,6 @@ MY_AC_ARG_WITH(oob, MY_DESCR([--without-oob], MY_AC_ARG_WITH(compiler-trace, MY_DESCR([--with-compiler-trace], [enable tracing of the compiler]), [AC_DEFINE(YYDEBUG)]) -MY_AC_ARG_WITH(atomic-svalue, - MY_DESCR([--with-atomic-svalue], - [change the svalue representation to one]) -MY_DESCR([],[supporting atomic changes (EXPERIMENTAL)]), - [ AC_DEFINE(ATOMIC_SVALUE) - PIKE_MSG_WARN([Atomic svalues enabled.]) - ]) AC_ARG_WITH(security, MY_DESCR([--with-security], [enable internal pike security system]), [AC_MSG_ERROR([Pike security is deprecated. Use --with-deprecated-security to enable.])]) diff --git a/src/mapping.c b/src/mapping.c index 6ff88dd47fededc725e145d123c8a0ea1851819b..ddc9fecd67b709b5efeede8292ec629c0eb109a4 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -221,9 +221,6 @@ static void init_mapping(struct mapping *m, md->flags = flags; /* md->size = 0; */ /* md->refs=0; */ -#ifdef ATOMIC_SVALUE - md->ref_type = T_MAPPING_DATA; -#endif /* md->valrefs=0; */ /* md->hardlinks=0; */ md->num_keypairs=size; @@ -261,9 +258,6 @@ PMOD_EXPORT struct mapping *debug_allocate_mapping(int size) INITIALIZE_PROT(m); init_mapping(m,size,0); -#ifdef ATOMIC_SVALUE - m->ref_type = T_MAPPING; -#endif m->refs = 0; add_ref(m); /* For DMALLOC... */ diff --git a/src/multiset.c b/src/multiset.c index f1fd4d25a722da4d28a963edba5edf33bf45738a..6cd15d3d939084c4fc92e4732d7abe721b41ff48 100644 --- a/src/multiset.c +++ b/src/multiset.c @@ -233,26 +233,14 @@ static struct multiset_data empty_indval_msd = { void free_multiset_data (struct multiset_data *msd); -#ifdef ATOMIC_SVALUE #define INIT_MULTISET(L) do { \ GC_ALLOC (L); \ INITIALIZE_PROT (L); \ - L->ref_type = T_MULTISET; \ L->refs = 0; \ add_ref(L); /* For DMALLOC... */ \ L->node_refs = 0; \ DOUBLELINK (first_multiset, L); \ } while (0) -#else /* !ATOMIC_SVALUE */ -#define INIT_MULTISET(L) do { \ - GC_ALLOC (L); \ - INITIALIZE_PROT (L); \ - L->refs = 0; \ - add_ref(L); /* For DMALLOC... */ \ - L->node_refs = 0; \ - DOUBLELINK (first_multiset, L); \ - } while (0) -#endif static struct block_allocator multiset_allocator = BA_INIT_PAGES(sizeof(struct multiset), 2); diff --git a/src/pike_types.c b/src/pike_types.c index db79db7d3e928178d7ae70431f00960eaf6fa5ce..c90a9fd38aee2f2d8ba55adf0645a69775119425 100644 --- a/src/pike_types.c +++ b/src/pike_types.c @@ -576,9 +576,6 @@ static inline struct pike_type *debug_mk_type(unsigned INT32 type, debug_malloc_pass(t = ba_alloc(&type_allocator)); -#ifdef ATOMIC_SVALUE - t->ref_type = PIKE_T_TYPE; -#endif t->refs = 0; add_ref(t); /* For DMALLOC... */ t->type = type; diff --git a/src/pike_types.h b/src/pike_types.h index 71edea4ac93820593a3e7f32117dd491b5f80731..0f980a76b810c2e0e6b32ec2277fff6687e54f3e 100644 --- a/src/pike_types.h +++ b/src/pike_types.h @@ -24,9 +24,6 @@ void TYPE_STACK_DEBUG(const char *fun); struct pike_type { INT32 refs; -#ifdef ATOMIC_SVALUE - INT32 ref_type; -#endif unsigned INT32 hash; struct pike_type *next; unsigned INT32 flags; diff --git a/src/stralloc.h b/src/stralloc.h index b3b1843aed12eac0d5d2c0a96d126e767c4f8568..666ebd7b3a95b04ed6390a9dac0a428969538cc7 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -22,28 +22,15 @@ enum size_shift { thirtytwobit=2, }; -#ifdef ATOMIC_SVALUE -#define PIKE_STRING_CONTENTS \ - INT32 refs; \ - INT32 ref_type; \ - unsigned char flags; \ - unsigned char size_shift; \ - unsigned char min; \ - unsigned char max; \ +#define PIKE_STRING_CONTENTS \ + INT32 refs; \ + unsigned char flags; \ + enum size_shift size_shift:8; \ + unsigned char min; \ + unsigned char max; \ ptrdiff_t len; /* Not counting terminating NUL. */ \ size_t hval; \ struct pike_string *next -#else /* !ATOMIC_SVALUE */ -#define PIKE_STRING_CONTENTS \ - INT32 refs; \ - unsigned char flags; \ - enum size_shift size_shift:8; \ - unsigned char min; \ - unsigned char max; \ - ptrdiff_t len; /* Not counting terminating NUL. */ \ - size_t hval; \ - struct pike_string *next -#endif struct pike_string { diff --git a/src/svalue.h b/src/svalue.h index 7359dbb2641194853a15716779c4edd71c214e57..ac3623546ba87573733eae70352eccdee98aee19 100644 --- a/src/svalue.h +++ b/src/svalue.h @@ -855,55 +855,15 @@ static INLINE TYPE_FIELD __attribute__((unused)) dmalloc_gc_cycle_check_svalues #endif /* !NO_PIKE_SHORTHAND */ -#ifdef ATOMIC_SVALUE -/* Atomic svalues: Store the type in the reference types, - * instead of on the stack. This allows for changing an - * svalue in a single atomic operation. - */ -#define PIKE_MEMORY_OBJECT_MEMBERS \ - INT32 refs; \ - INT32 ref_type \ - DO_IF_SECURITY(; struct object *prot) \ - -#ifdef PIKE_SECURITY -#ifdef USE_LOCAL_MUTEX -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, type, 0, PTHREAD_MUTEX_INITIALIZER -#else -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, type, 0 -#endif -#else -#ifdef USE_LOCAL_MUTEX -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, type, PTHREAD_MUTEX_INITIALIZER -#else -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, type -#endif -#endif - -#define INIT_PIKE_MEMOBJ(X, TYPE) do { \ - struct ref_dummy *v_=(struct ref_dummy *)(X); \ - v_->ref_type = (TYPE); \ - v_->refs=0; \ - add_ref(v_); /* For DMALLOC... */ \ - DO_IF_SECURITY( INITIALIZE_PROT(v_) ); \ -}while(0) -#else /* !ATOMIC_SVALUE */ #define PIKE_MEMORY_OBJECT_MEMBERS \ INT32 refs \ DO_IF_SECURITY(; struct object *prot) \ #ifdef PIKE_SECURITY -#ifdef USE_LOCAL_MUTEX -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, 0, PTHREAD_MUTEX_INITIALIZER -#else #define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, 0 -#endif -#else -#ifdef USE_LOCAL_MUTEX -#define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs, PTHREAD_MUTEX_INITIALIZER #else #define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs #endif -#endif #define INIT_PIKE_MEMOBJ(X, TYPE) do { \ struct ref_dummy *v_=(struct ref_dummy *)(X); \ @@ -911,14 +871,12 @@ static INLINE TYPE_FIELD __attribute__((unused)) dmalloc_gc_cycle_check_svalues add_ref(v_); /* For DMALLOC... */ \ DO_IF_SECURITY( INITIALIZE_PROT(v_) ); \ }while(0) -#endif /* ATOMIC_SVALUE */ #define EXIT_PIKE_MEMOBJ(X) do { \ struct ref_dummy *v_=(struct ref_dummy *)(X); \ DO_IF_SECURITY( FREE_PROT(v_) ); \ }while(0) - struct ref_dummy { PIKE_MEMORY_OBJECT_MEMBERS;