MCPcopy Create free account
hub / github.com/DFHack/dfhack / detect_size

Function detect_size

plugins/devel/memview.cpp:116–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116size_t detect_size(void *addr) {
117 size_t *size = (size_t*)((char*)addr - 16);
118 uint32_t *tag = (uint32_t*)((char*)addr - 8);
119 if (isAddr(size, memdata.ranges) && (*tag == 0x11223344 || *tag == 0xdfdf4ac8)) {
120 return *size;
121 }
122 // default
123 return 20 * 16;
124}
125
126DFhackCExport command_result plugin_onupdate (color_ostream &out)
127{

Callers 1

memviewFunction · 0.85

Calls 1

isAddrFunction · 0.85

Tested by

no test coverage detected