加载中…
加载中…
加载中…
加载中…
标签:
杂谈 |
标签:
杂谈 |
标签:
杂谈 |
标签:
杂谈 |
Troubleshooting memcached is not so transparent as some other technologies, but testing memcached using telnet commands can give us quite some insight on what’s happening under the hood.
Following is a short list of useful commands to inspect a running memcached instance.
ps aux | grep memcached will give us the process running memcached, with listening ip address and port. If this command does not yield any results, you likely not running the daemon and need to start it up first.
telnet 127.0.0.1 11211 (replace your IP address and port)
The following is a list of
标签:
杂谈 |
标签:
杂谈 |
标签:
杂谈 |
标签:
杂谈 |
'placement new'?
它 到底是什么东东呀?我也是最近几天才听说,看来对于C++我还差很远呀!placement new
是重载operator new的一个标准、全局的版本,它不能被自定义的版本代替(不像普通的operator new和operator
delete能够被替换成用户自定义的版本)。
它的原型如下:
void *operator new( size_t, void *p ) throw()
首先我们区分下几个容易混淆的关键词:new、operator new、placement new
new和delete操作符我们应该都用过,它们是对堆中的内存进行申请和释放,而这两个都是不能被重载的。要实现不同的内存分配行为,需要重载operator
new,而不是new和delete。
看如下代码:
class MyClass {…};
MyClass * p=new MyClass;
这
标签:
杂谈 |