@@ -31,7 +31,8 @@ class ValidationUtils;
31
31
extern const Value Empty;
32
32
33
33
#define DECLARE_PTR_TYPEDEFS (klass ) \
34
- typedef intrusive_ptr<klass> Ptr
34
+ typedef intrusive_ptr<klass> Ptr; \
35
+ typedef intrusive_ptr<const klass> ConstPtr
35
36
36
37
#define IMPL_TYPE_LOOKUP_SUPER () \
37
38
@@ -192,7 +193,7 @@ class Object
192
193
Object (const Object& other) = delete ;
193
194
Object& operator =(const Object& rhs) = delete ;
194
195
195
- std::atomic<uint_fast64_t > m_References;
196
+ mutable std::atomic<uint_fast64_t > m_References;
196
197
mutable std::recursive_mutex m_Mutex;
197
198
198
199
#ifdef I2_DEBUG
@@ -202,17 +203,17 @@ class Object
202
203
203
204
friend struct ObjectLock ;
204
205
205
- friend void intrusive_ptr_add_ref (Object *object);
206
- friend void intrusive_ptr_release (Object *object);
206
+ friend void intrusive_ptr_add_ref (const Object *object);
207
+ friend void intrusive_ptr_release (const Object *object);
207
208
};
208
209
209
210
Value GetPrototypeField (const Value& context, const String& field, bool not_found_error, const DebugInfo& debugInfo);
210
211
211
- void TypeAddObject (Object *object);
212
- void TypeRemoveObject (Object *object);
212
+ void TypeAddObject (const Object *object);
213
+ void TypeRemoveObject (const Object *object);
213
214
214
- void intrusive_ptr_add_ref (Object *object);
215
- void intrusive_ptr_release (Object *object);
215
+ void intrusive_ptr_add_ref (const Object *object);
216
+ void intrusive_ptr_release (const Object *object);
216
217
217
218
template <typename T>
218
219
class ObjectImpl
0 commit comments