MCPcopy Create free account
hub / github.com/DFHack/dfhack / command_result plugin_onupdate

Function command_result plugin_onupdate

plugins/devel/memview.cpp:126–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126DFhackCExport command_result plugin_onupdate (color_ostream &out)
127{
128
129 mymutex->lock();
130 if(memdata.state==STATE_OFF)
131 {
132 mymutex->unlock();
133 return CR_OK;
134 }
135 //Console &con=out;
136 uint64_t time2 = GetTimeMs64();
137 uint64_t delta = time2-timeLast;
138
139 if(memdata.refresh!=0)
140 if(delta<memdata.refresh)
141 {
142 mymutex->unlock();
143 return CR_OK;
144 }
145 timeLast = time2;
146
147 Core::getInstance().p->read(memdata.addr,memdata.len,memdata.buf);
148 outputHex(memdata.buf,memdata.lbuf,memdata.len,(size_t)memdata.addr,out,memdata.ranges);
149 memcpy(memdata.lbuf, memdata.buf, memdata.len);
150 if(memdata.refresh==0)
151 Deinit();
152 mymutex->unlock();
153 return CR_OK;
154
155}
156command_result memview (color_ostream &out, vector <string> & parameters)
157{
158 mymutex->lock();

Callers

nothing calls this directly

Calls 6

GetTimeMs64Function · 0.85
outputHexFunction · 0.85
DeinitFunction · 0.85
lockMethod · 0.45
unlockMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected