matrix icon indicating copy to clipboard operation
matrix copied to clipboard

内存日志对于不同大小的内存块为什么需要分开存储呢?

Open zhangjiuzhou opened this issue 2 years ago • 0 comments

想请教一下,小块内存(<128)和大块内存会分开存储,这样做的原因是什么呢?

void allocation_event_db_add(
allocation_event_db *db_context, uint64_t address, uint32_t type_flags, uint32_t object_type, uint32_t size, uint32_t stack_identifier) {
    if ((type_flags & memory_logging_type_alloc) && /*(address & 0x1f) == 0 && */ size <= 128) {
        __allocation_event_db_add(db_context, address, type_flags, object_type, size, stack_identifier);
    } else {
        db_context->allocation_event_list->insert(address, allocation_event(type_flags, object_type, stack_identifier, size));
    }
}

zhangjiuzhou avatar Feb 12 '23 04:02 zhangjiuzhou