diff options
Diffstat (limited to 'Database/internals/database-segment.h')
-rw-r--r-- | Database/internals/database-segment.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Database/internals/database-segment.h b/Database/internals/database-segment.h index dc4d157..de8e850 100644 --- a/Database/internals/database-segment.h +++ b/Database/internals/database-segment.h @@ -56,6 +56,38 @@ class Segment : public Base { void LoadMemory(Handle * src); void setTag(Uint32 ptr, memory_tags_t tag); memory_tags_t getTag(Uint32 ptr); + void setBasicTag(Uint32 ptr, basic_tags_t tag) { + memory_tags_t t = getTag(ptr); + t.basic_tag = tag; + setTag(ptr, t); + } + basic_tags_t getBasicTag(Uint32 ptr) { + return (basic_tags_t) getTag(ptr).basic_tag; + } + void setCrawled(Uint32 ptr, bool crawled) { + memory_tags_t t = getTag(ptr); + t.crawled = crawled ? 1 : 0; + setTag(ptr, t); + } + bool getCrawled(Uint32 ptr) { + return getTag(ptr).crawled; + } + void setCertitude(Uint32 ptr, int certitude) { + if (certitude < 0) + certitude = -1; + if (certitude > 15) + certitude = 15; + memory_tags_t t = getTag(ptr); + t.certitude = certitude + 1; + } + int getCertitude(Uint32 ptr) { + return getTag(ptr).certitude - 1; + } + void ResetCrawled() { + for (Uint32 ptr = 0; ptr < size; ptr++) { + tags[ptr].crawled = 0; + } + } Uint32 getSize() { return size; } Uint64 getFullSize() { return size + extra_size; } Uint64 getCpuBase() { return cpu_base; } |