随笔分类 -  c&c++

摘要:1.定义java类中的native方法,新建下面一个类public class NativeDemo { public static native void say(); //static的native方法 public native void sayHello(); //实例的native方法,两者的处理不一样 public static int number = 10; int a = 2; public void callThis(){ System.out.println("c++ c... 阅读全文
posted @ 2012-05-31 13:38 zhwj184 阅读(391) 评论(0) 推荐(0)
摘要:/* Our hash table capability is a power of two */ static unsigned long _dictNextPower(unsigned long size) { unsigned long i = DICT_HT_INITIAL_SIZE; //DICT_HT_INITIAL_SIZE=4 if (size >= LONG_MAX) return LONG_MAX; while(1) { if (i >= size) return i; i *= 2; ... 阅读全文
posted @ 2012-05-31 13:29 zhwj184 阅读(165) 评论(0) 推荐(0)