disable construct of ObIAllocator
This commit is contained in:
		| @ -87,7 +87,7 @@ public: | ||||
|   { | ||||
|     (void)set_data(buf_, MAX_MSGBUF_SIZE); | ||||
|   } | ||||
|   ~ObElectionMsgBuffer() | ||||
|   virtual ~ObElectionMsgBuffer() | ||||
|   {} | ||||
|  | ||||
|   TO_STRING_KV(K_(capacity), K_(position), K_(limit)); | ||||
|  | ||||
| @ -57,12 +57,16 @@ public: | ||||
|   ObSmallArena(); | ||||
|   ~ObSmallArena(); | ||||
|   void *alloc_aligned(const int64_t size, const int64_t align); | ||||
|   void *alloc(const int64_t size, const common::ObMemAttr &attr) | ||||
|   virtual void *alloc(const int64_t size, const common::ObMemAttr &attr) override | ||||
|   { | ||||
|     UNUSEDx(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   void *alloc(const int64_t size); | ||||
|   virtual void *alloc(const int64_t size) override; | ||||
|   virtual void free(void *ptr) override | ||||
|   { | ||||
|     UNUSED(ptr); | ||||
|   } | ||||
|   void reset(); | ||||
|   int64_t get_small_alloc_count() const; | ||||
|   int64_t get_large_alloc_count() const; | ||||
|  | ||||
| @ -2173,12 +2173,12 @@ public: | ||||
|   ObSchemaAllocator(common::ObIAllocator &allocator) : allocator_(&allocator) | ||||
|   {} | ||||
|  | ||||
|   virtual void *alloc(const int64_t sz) | ||||
|   virtual void* alloc(const int64_t sz) override | ||||
|   { | ||||
|     return alloc(sz, common::default_memattr); | ||||
|   } | ||||
|  | ||||
|   virtual void *alloc(const int64_t sz, const common::ObMemAttr &attr) | ||||
|   virtual void* alloc(const int64_t sz, const common::ObMemAttr& attr) override | ||||
|   { | ||||
|     void *ret = NULL; | ||||
|     if (allocator_) { | ||||
| @ -2187,6 +2187,10 @@ public: | ||||
|     return ret; | ||||
|   } | ||||
|  | ||||
|   virtual void free(void *p) override | ||||
|   { | ||||
|     allocator_->free(p); | ||||
|   } | ||||
|   virtual ~ObSchemaAllocator(){}; | ||||
|  | ||||
| private: | ||||
|  | ||||
| @ -344,6 +344,15 @@ public: | ||||
|   {} | ||||
|  | ||||
|   void* alloc(const int64_t size) override; | ||||
|   void* alloc(const int64_t size, const common::ObMemAttr& attr) override | ||||
|   { | ||||
|     UNUSED(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   void free(void* ptr) override | ||||
|   { | ||||
|     UNUSED(ptr); | ||||
|   } | ||||
|  | ||||
| private: | ||||
|   int64_t off_; | ||||
|  | ||||
| @ -41,6 +41,15 @@ public: | ||||
|   } | ||||
|  | ||||
|   virtual void* alloc(const int64_t size) override; | ||||
|   virtual void* alloc(const int64_t size, const common::ObMemAttr& attr) override | ||||
|   { | ||||
|     UNUSED(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   virtual void free(void* ptr) override | ||||
|   { | ||||
|     UNUSED(ptr); | ||||
|   } | ||||
|  | ||||
| private: | ||||
|   common::ObIAllocator* alloc_; | ||||
|  | ||||
| @ -31,11 +31,16 @@ public: | ||||
|  | ||||
|   int init(const int64_t obj_size, const char* label, uint64_t tenant_id_); | ||||
|  | ||||
|   void* alloc(int64_t sz) | ||||
|   void* alloc(const int64_t sz) override | ||||
|   { | ||||
|     return alloc_(sz); | ||||
|   } | ||||
|   void free(void* ptr) | ||||
|   void* alloc(const int64_t size, const common::ObMemAttr& attr) override | ||||
|   { | ||||
|     UNUSED(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   void free(void* ptr) override | ||||
|   { | ||||
|     free_(ptr); | ||||
|   } | ||||
|  | ||||
| @ -168,7 +168,7 @@ public: | ||||
|     ATOMIC_STORE(&free_count_, 0); | ||||
|     ATOMIC_STORE(&alloc_size_, 0); | ||||
|   } | ||||
|   void* alloc(const int64_t size) | ||||
|   void* alloc(const int64_t size) override | ||||
|   { | ||||
|     void* ret = nullptr; | ||||
|     if (OB_ISNULL(ret = allocator_.alloc(size))) { | ||||
| @ -179,7 +179,12 @@ public: | ||||
|     } | ||||
|     return ret; | ||||
|   } | ||||
|   void free(void* ptr) | ||||
|   void* alloc(const int64_t size, const ObMemAttr& attr) override | ||||
|   { | ||||
|     UNUSED(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   void free(void* ptr) override | ||||
|   { | ||||
|     if (OB_ISNULL(ptr)) { | ||||
|       // do nothing | ||||
| @ -244,7 +249,7 @@ public: | ||||
|     ATOMIC_STORE(&free_count_, 0); | ||||
|     ATOMIC_STORE(&alloc_size_, 0); | ||||
|   } | ||||
|   void* alloc(const int64_t size) | ||||
|   void* alloc(const int64_t size) override | ||||
|   { | ||||
|     void* ret = nullptr; | ||||
|     if (OB_ISNULL(ret = allocator_.alloc(size))) { | ||||
| @ -255,7 +260,12 @@ public: | ||||
|     } | ||||
|     return ret; | ||||
|   } | ||||
|   void free(void* ptr) | ||||
|   void* alloc(const int64_t size, const ObMemAttr& attr) override | ||||
|   { | ||||
|     UNUSED(attr); | ||||
|     return alloc(size); | ||||
|   } | ||||
|   void free(void* ptr) override | ||||
|   { | ||||
|     if (OB_ISNULL(ptr)) { | ||||
|       // do nothing | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 nroskill
					nroskill