diff --git a/inc/hgl/thread/RingBuffer.h b/inc/hgl/thread/RingBuffer.h index 461a207..d1309b6 100644 --- a/inc/hgl/thread/RingBuffer.h +++ b/inc/hgl/thread/RingBuffer.h @@ -9,7 +9,7 @@ namespace hgl /** * 多线程环形数据流,用于随时被读或写的情况以及在多线程应用中同时被读与写的情况。 */ - template class RingBuffer:protected ThreadMutex ///多线程环形数据流 + template class RingBuffer:protected ThreadMutex ///多线程环形数据流 { protected: diff --git a/inc/hgl/type/Map.cpp b/inc/hgl/type/Map.cpp index 4ec26d3..125e3f2 100644 --- a/inc/hgl/type/Map.cpp +++ b/inc/hgl/type/Map.cpp @@ -606,7 +606,7 @@ namespace hgl if(count<=0)return; - with_list.PreMalloc(count); + with_list.PreAlloc(count); const KVData *sp=this->GetDataList(); @@ -630,7 +630,7 @@ namespace hgl if(count<=0)return; - without_list.PreMalloc(count); + without_list.PreAlloc(count); const KVData *sp=this->GetDataList(); diff --git a/inc/hgl/type/ObjectList.cpp b/inc/hgl/type/ObjectList.cpp index d8b9f6b..665e17c 100644 --- a/inc/hgl/type/ObjectList.cpp +++ b/inc/hgl/type/ObjectList.cpp @@ -64,9 +64,9 @@ namespace hgl * 在指定位置插入一个对象 */ template - void CusObjectList::Insert(int index,const ItemPointer &obj) + bool CusObjectList::Insert(int index,const ItemPointer &obj) { - List::Insert(index,obj); + return List::Insert(index,obj); } /** diff --git a/inc/hgl/type/Pool.cpp b/inc/hgl/type/Pool.cpp index 4f37530..2837b2a 100644 --- a/inc/hgl/type/Pool.cpp +++ b/inc/hgl/type/Pool.cpp @@ -6,7 +6,7 @@ namespace hgl { template - void Pool::PreMalloc(int num,bool set_to_max_count) + void Pool::PreAlloc(int num,bool set_to_max_count) { if(num<=0)return; diff --git a/inc/hgl/type/Pool.h b/inc/hgl/type/Pool.h index 8914837..feef0fc 100644 --- a/inc/hgl/type/Pool.h +++ b/inc/hgl/type/Pool.h @@ -44,7 +44,7 @@ namespace hgl Pool(){alloc_count=0;history_max=0;max_count=0;} virtual ~Pool()=default; - virtual void PreMalloc(int,bool set_to_max=false); ///<预分配空间 + virtual void PreAlloc(int,bool set_to_max=false); ///<预分配空间 virtual int SetMaxCount(int); ///<设定最大数量限制 diff --git a/inc/hgl/type/SortedSets.h b/inc/hgl/type/SortedSets.h index 3cbeaf1..22b3997 100644 --- a/inc/hgl/type/SortedSets.h +++ b/inc/hgl/type/SortedSets.h @@ -32,7 +32,7 @@ namespace hgl virtual ~SortedSets()=default; void SetCount (int count){data_list.SetCount(count);} ///<指定数据数量,一般用于批量加载前的处理 - void PreMalloc (int count){data_list.PreMalloc(count);} ///<预分配指定数量的数据空间 + void PreAlloc (int count){data_list.PreAlloc(count);} ///<预分配指定数量的数据空间 const int Find (const T &)const; ///<查找数据位置,不存在返回-1 const bool IsMember (const T &v)const{return(Find(v)!=-1);} ///<确认是否成员