cocos2d-x jsb 绑定 removeAllDelegates

html5版为

cc.Director.getInstance().getTouchDispatcher().removeAllDelegates();

但 jsb 下没有,绑定一下。

void JSTouchDelegate::removeAllDelegates() {
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeAllDelegates();
}


JSBool js_cocos2dx_JSTouchDelegate_removeAllDelegates(JSContext *cx, uint32_t argc, jsval *vp)
{
	if (argc == 0) {        
        JSTouchDelegate *touch = new JSTouchDelegate();
        touch->autorelease();
        touch->removeAllDelegates();
		return JS_TRUE;
	}
    JS_ReportError(cx, "wrong number of arguments");
	return JS_FALSE;
}


JS_DefineFunction(cx, ns, "removeAllDelegates", js_cocos2dx_JSTouchDelegate_removeAllDelegates, 1, JSPROP_READONLY | JSPROP_PERMANENT);

阿里云(aliyun)青岛节点挂载硬盘io测试

杭州节点已经停售了,在青岛订购了一台,贴上测试结果。

fdisk -l

Disk /dev/xvda: 21.5 GB, 21474754560 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00090497

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        2611    20969472   83  Linux

Disk /dev/xvdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvdb doesn't contain a valid partition table

分区

fdisk /dev/xvdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xbe797f61.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6527, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527): 
Using default value 6527

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


格式成 ext3

mkfs.ext3 /dev/xvdb1

挂载分区

mkdir /pub
mount /dev/xvdb1 /pub

写入速度测试

dd if=/dev/zero of=test bs=64k count=4k oflag=dsync
4096+0 records in
4096+0 records out
268435456 bytes (268 MB) copied, 81.2347 s, 3.3 MB/s

好可怜啊。。

cpu 信息

cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
stepping	: 7
cpu MHz		: 1900.054
cache size	: 15360 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good pni ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm
bogomips	: 3800.10
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
stepping	: 7
cpu MHz		: 1900.054
cache size	: 15360 KB
physical id	: 2
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good pni ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm
bogomips	: 3808.34
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

内存信息

free -m
             total       used       free     shared    buffers     cached
Mem:          2011        809       1202          0        123        615
-/+ buffers/cache:         70       1940
Swap:            0          0          0

系统信息

cat /etc/issue
Debian GNU/Linux 6.0 \n \l