代码拉取完成,页面将自动刷新
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdexcept>
#include "ssd.h"
namespace ssd {
/*
* Buffer used for accessing data pages.
*/
void *global_buffer;
}
using namespace ssd;
enum status Page::_read(Event &event)
{
event.incr_execution_time(PAGE_READ_DELAY);
/*if (PAGE_ENABLE_DATA)
global_buffer = (char*)page_data + event.get_address().get_linear_address() * PAGE_SIZE;
*/
return SUCCESS;
}
enum status Page::_write(Event &event)
{
event.incr_execution_time(PAGE_WRITE_DELAY);
/*if (PAGE_ENABLE_DATA && event.get_payload() != NULL && event.get_noop() == false)
{
void *data = (char*)page_data + event.get_address().get_linear_address() * PAGE_SIZE;
memcpy (data, event.get_payload(), PAGE_SIZE);
}*/
if (state != EMPTY) {
printf("You are trying to overwrite a page that is not free. This is illegal. The operations is: \n");
event.print();
}
logical_addr = event.get_logical_address();
assert(state == EMPTY);
state = VALID;
return SUCCESS;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。