2008 March 27th Thursday (三月 二十七日 木曜日)
来源:互联网 发布:跳过广告的软件 编辑:程序博客网 时间:2024/04/27 21:53
The time is so scare as to complete our project on schedule. So, the leader made a decision that we have to be on duty this Saturday.
The updating DB function was added into our project. I don't known why the Java group give up this function, so we have to implement it in C language.
The duplication function from our customer is so complicated from devices to devices, and varing with versions and with environments. So, the duplication
is related to many cases that we must considered.
new and delete operation
The pseudocode of new operator (non-member style) is as follow.
void * operator new(size_t size) // operator new may has other parameters.
{
if (size == 0) { // when request size is 0,
size = 1; // convert 0 to 1.
}
while (1) {
allocate_memory();
if (OK)
return (the pointer to the memory);
// failed, install the global new handler.
new_handler globalhandler = set_new_handler(0);
set_new_handler(globalhandler);
if (globalhandler) (*globalhandler)();
else throw std::bad_alloc();
}
}
The pseudocode of new operator (member style) is as follow.
void * base::operator new(size_t size)
{
if (size != sizeof(base))
return ::operator new(size);
...
}
There also are the pseudocode of delete operator (non-member and member styles) are follow.
void operator delete(void *rawmemory)
{
if (rawmemory == 0) return;
//
free_memory();
return;
}
class base {
public: // operator delete
static void * operator new(size_t size);
static void operator delete(void *rawmemory, size_t size);
...
};
void base::operator delete(void *rawmemory, size_t size)
{
if (rawmemory == 0) return; // check null pointer
if (size != sizeof(base)) { // check size
::operator delete(rawmemory); // invoke standard delete operator
return;
}
free_memory();
return;
}
2008 March 28th Friday (三月 二十八日 金曜日)
Today we almost took one work day to look through the sources of this projects again.
We are going to experiment tomorrow. However, on this noon, one device was crashed.
The updating DB function was added into our project. I don't known why the Java group give up this function, so we have to implement it in C language.
The duplication function from our customer is so complicated from devices to devices, and varing with versions and with environments. So, the duplication
is related to many cases that we must considered.
new and delete operation
The pseudocode of new operator (non-member style) is as follow.
void * operator new(size_t size) // operator new may has other parameters.
{
if (size == 0) { // when request size is 0,
size = 1; // convert 0 to 1.
}
while (1) {
allocate_memory();
if (OK)
return (the pointer to the memory);
// failed, install the global new handler.
new_handler globalhandler = set_new_handler(0);
set_new_handler(globalhandler);
if (globalhandler) (*globalhandler)();
else throw std::bad_alloc();
}
}
The pseudocode of new operator (member style) is as follow.
void * base::operator new(size_t size)
{
if (size != sizeof(base))
return ::operator new(size);
...
}
There also are the pseudocode of delete operator (non-member and member styles) are follow.
void operator delete(void *rawmemory)
{
if (rawmemory == 0) return;
//
free_memory();
return;
}
class base {
public: // operator delete
static void * operator new(size_t size);
static void operator delete(void *rawmemory, size_t size);
...
};
void base::operator delete(void *rawmemory, size_t size)
{
if (rawmemory == 0) return; // check null pointer
if (size != sizeof(base)) { // check size
::operator delete(rawmemory); // invoke standard delete operator
return;
}
free_memory();
return;
}
2008 March 28th Friday (三月 二十八日 金曜日)
Today we almost took one work day to look through the sources of this projects again.
We are going to experiment tomorrow. However, on this noon, one device was crashed.
- 2008 March 27th Thursday (三月 二十七日 木曜日)
- 2008 March 14th Thursday (三月 十四日 木曜日)
- 2008 March 20th Thursday (三月 二十日 木曜日)
- March 27th Tuesday (三月 二十七日 火曜日)
- 2009 March 27th Friday (三月 二十七日 金曜日)
- March 22th Thursday (三月 二十二日 木曜日)
- March 29th Thursday (三月 二十九日 木曜日)
- 2009 March 26th Thursday (三月 二十六日 木曜日)
- 2008 March 17th Monday (三月 十七日 月曜日)
- 2008 November 27th Thursday (十一月 二十七日 木曜日)
- September 27th Thursday (九月 二十七日 木曜日)
- 2008 March 6th Thursday (三月 六日 木曜日
- March 8th Thursday (三月 八日 木曜日)
- December 27th Thursday (十二月 二十七日 木曜日)
- March 15th Thursday (三月 十五日 木曜日)
- 2009 March 5th Thursday (三月 五日 木曜日)
- 2009 March 12th Thursday (三月 十二日 木曜日)
- 2009 March 19th Thursday (三月 十九日 木曜日)
- 2008 March 24th Monday (三月 二十四日 月曜日)
- 2008 March 25th Tuesday (三月 二十五日 火曜日)
- Subvertion+apache2.2.8+winxp
- 2008 March 26th Wednesday (三月 二十六日 水曜日)
- 清除AD过期的帐户和计算机
- 2008 March 27th Thursday (三月 二十七日 木曜日)
- 发布一个用于和GridView或DataGrid表格相关联的查找搜索服务器控件
- 2008 March 29th Saturday (三月 二十九日 土曜日)
- 向父页面提交内容并关闭子页面
- 2008 March 31th Monday (三月 三十一日 月曜日)
- 照相机的基本知识
- [顶]学黑客必去的网站“黑客基地”
- uClinux在S3C44B0X上的移植
- 用C/C++写上传文件的CGI,遇到问题