1 Star 2 Fork 0

InnovatorNZ/CppGCPtr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
GCRegionalHashMap.h 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef CPPGCPTR_GCREGIONALHASHMAP_H
#define CPPGCPTR_GCREGIONALHASHMAP_H
#include <unordered_map>
#include <shared_mutex>
#include <mutex>
#include <optional>
#include "GCStatus.h"
#include "GCPhase.h"
#include "Iterator.h"
class GCRegionalHashMap {
private:
std::unordered_map<void*, GCStatus> object_map;
std::shared_mutex map_mutex_;
public:
class RegionalHashMapIterator : public Iterator<GCStatus> {
private:
GCRegionalHashMap& regionalHashmap;
decltype(object_map)::iterator it;
bool iterate_begun;
public:
explicit RegionalHashMapIterator(GCRegionalHashMap&);
~RegionalHashMapIterator() override;
GCStatus current() const override;
bool MoveNext() override;
void* getCurrentAddress() const;
void setCurrentMarkState(MarkState);
};
GCRegionalHashMap();
bool mark(void* object_addr, size_t object_size, MarkState markState,
bool overwrite = false, bool emplace_if_not_exist = true);
std::optional<MarkState> getMarkState(void* object_addr);
RegionalHashMapIterator getIterator();
void clear();
};
#endif //CPPGCPTR_GCREGIONALHASHMAP_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/innovatornz/CppGCPtr.git
git@gitee.com:innovatornz/CppGCPtr.git
innovatornz
CppGCPtr
CppGCPtr
master

搜索帮助