Changeset 35100
- Timestamp:
- 08/27/09 22:29:06 (4 years ago)
- Location:
- lang/objective-cplusplus/i3/trunk
- Files:
-
- 2 added
- 10 modified
-
configure.ac (modified) (1 diff)
-
src/Test1.cpp (modified) (2 diffs)
-
src/Test2.cpp (modified) (2 diffs)
-
src/gui-windows/InputWindowPlatform.cpp (modified) (3 diffs)
-
src/mil/include/mil/Memory.h (modified) (8 diffs)
-
src/mil/include/mil/StaticData.cpp (modified) (1 diff)
-
src/mil/src/Profile1.cpp (added)
-
src/mil/src/Test1.cpp (modified) (1 diff)
-
src/mil/src/Test11.cpp (modified) (3 diffs)
-
src/os-windows/Os.cpp (modified) (1 diff)
-
windows/fakecygpty.exe.xz (modified) (previous)
-
windows/mil_profile.vcproj (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/configure.ac
r34908 r35100 12 12 13 13 AC_CONFIG_AUX_DIR([build-aux]) 14 #AM_INIT_AUTOMAKE([gnu no-define check-news std-options filename-length-max=99 ])15 AM_INIT_AUTOMAKE([ gnu no-define check-news std-options])14 #AM_INIT_AUTOMAKE([gnu no-define check-news std-options filename-length-max=99 color-tests]) 15 AM_INIT_AUTOMAKE([foreign no-define std-options color-tests]) 16 16 AC_CONFIG_SRCDIR([src/Main.cpp]) 17 17 AC_CONFIG_HEADER([config.h]) -
lang/objective-cplusplus/i3/trunk/src/Test1.cpp
r34947 r35100 11 11 using namespace std; 12 12 using namespace boost; 13 using namespace i3; 13 14 14 15 namespace ns_intrusrangaaaaaaaaa { … … 116 117 #if defined(_UNICODE) && defined(UNICODE) 117 118 #define JA_ENCODING ".UTF-16LE" 118 WCHAR hello_world_ja [] = {119 WCHAR hello_world_ja1[] = { 119 120 0x4E16, 0x754C, 0x3088, 0x002C, 120 121 0x0020, 0x3053, 0x3093, 0x306B, 121 0x3061, 0x306F, 0x0021, 0 x0000,122 0x3061, 0x306F, 0x0021, 0 122 123 }; 124 char hello_world_ja2[] = { 125 0x16, 0x4e, 0x4c, 0x75, 0x88, 0x30, 0x01, 0x30, 126 0x53, 0x30, 0x93, 0x30, 0x6b, 0x30, 0x61, 0x30, 127 0x8f, 0x30, 0x28, 0x00, 0x60, 0x00, 0xfb, 0x30, 128 0xc9, 0x03, 0xfb, 0x30, 0xb4, 0x00, 0x29, 0x00, 129 0, 0 130 }; 131 WCHAR* hello_world_ja = (WCHAR*)hello_world_ja2; 123 132 #else 124 133 #define JA_ENCODING ".Shift_JIS" 125 CHAR hello_world_ja [] = {134 CHAR hello_world_ja1[] = { 126 135 0x90, 0xA2, 0x8A, 0x45, 0x82, 0xE6, 0x2C, 127 136 0x20, 0x82, 0xB1, 0x82, 0xF1, 0x82, 0xC9, 128 0x82, 0xBF, 0x82, 0xCD, 0x21, 0 x00,137 0x82, 0xBF, 0x82, 0xCD, 0x21, 0 129 138 }; 139 CHAR hello_world_ja[] = { 140 0x90, 0xa2, 0x8a, 0x45, 0x82, 0xe6, 0x81, 141 0x41, 0x82, 0xb1, 0x82, 0xf1, 0x82, 0xc9, 142 0x82, 0xbf, 0x82, 0xed, 0x28, 0x60, 0x81, 143 0x45, 0x83, 0xd6, 0x81, 0x45, 0x81, 0x4c, 144 0x29, 0 145 }; 130 146 #endif 131 147 -
lang/objective-cplusplus/i3/trunk/src/Test2.cpp
r34947 r35100 6 6 #include <quicktest/quicktest.h> 7 7 8 using namespace mil; 8 9 using namespace i3; 9 10 … … 22 23 23 24 QT_TEST(test_basic_tcscat_s) { 24 QT_CHECK(get_config_dir() == NULL); 25 26 init_config_dir(); 27 28 TCHAR temp[MAX_PATH] = {}; 29 25 TCHAR temp[STACKABLE_MAX_PATH] = {}; 30 26 31 27 QT_CHECK(_tcscpy_s(temp, get_config_dir()) == 0); -
lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.cpp
r35077 r35100 11 11 12 12 struct ExecuteEvent { 13 TCHAR* command; 13 14 }; 14 15 16 struct AutoFree { 17 void* ptr; 18 AutoFree(void* ptr) : ptr(ptr) { 19 } 20 ~AutoFree() { 21 free(ptr); 22 } 23 }; 24 15 25 template <> 16 26 void Delegate::execute(ExecuteEvent& e) { 17 TCHAR prog[200] = {}; 18 //GetWindowText(e.hEdit, prog, _countof(prog)); 19 // if (_tcscmp(prog, _T("hello")) == 0) { 20 // alert(_("Hello, world!")); 21 // return; 22 // } else if (_tcscmp(prog, _T("exit")) == 0) { 23 // ExitEvent e; 24 // mediator.getInputWindow().post(e, *this); 25 // return; 26 // } 27 28 /* 29 TCHAR cwd_buf[MAX_PATH] = {}; 30 TCHAR* cwd = cwd_buf; 31 DWORD required = GetCurrentDirectory(_countof(cwd_buf), cwd_buf); 32 if (!required) { 33 return; // error 34 } else if (required > _countof(cwd_buf)) { 35 const size_t BUFFER_CHARS = 33000; 36 cwd = (TCHAR*)malloc(BUFFER_CHARS * sizeof(TCHAR)); 37 if (!cwd) { 38 return; // error 39 } 40 if (!GetCurrentDirectory(BUFFER_CHARS, cwd)) { 41 free(cwd); 42 return; // error 43 } 44 } 45 27 //std::tr1::shared_ptr<TCHAR> command_auto_free(e.command, free); 28 AutoFree command_auto_free(e.command); 29 30 if (_tcscmp(e.command, _T("hello")) == 0) { 31 alert(_("Hello, world!")); 32 return; 33 } else if (_tcscmp(e.command, _T("exit")) == 0) { 34 ExitEvent e; 35 mediator.getInputWindow().post(e, *this); 36 return; 37 } 46 38 47 39 HINSTANCE ins = ShellExecute( 48 40 NULL, // �e�E�B���h�E�̃n���h�� 49 _T("open"), // ���� prog,// �����ۂ̃t�@�C��50 NULL, // �����p�����[�^51 cwd,// ���f�B���N�g��52 SW_SHOW // �\����41 _T("open"), // ���� e.command, // �����ۂ̃t�@�C�� 42 NULL, // �����p�����[�^ 43 NULL, // ���f�B���N�g�� 44 SW_SHOW // �\���� 53 45 ); 54 46 55 if (cwd != cwd_buf) {56 free(cwd);57 }58 47 if ((INT)ins <= 32) { 59 alert(_T("failure")); 60 } 61 */ 48 alert(_T("execute failure")); 49 } 62 50 } 63 51 … … 70 58 71 59 struct EditChangedEvent { 72 HWND hEdit;60 int serial; 73 61 }; 74 62 … … 367 355 } else if (filter->wParam == VK_RETURN) { 368 356 ExecuteEvent e; 357 e.command = _tcsdup(&(getChild().local_input_cache[0])); 358 if (unlikely(!e.command)) { 359 return; 360 } 369 361 getChild().mediator.getDelegate().post(e, *this); 370 362 } -
lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Memory.h
r35077 r35100 86 86 87 87 #define MIL_MALLOC_PRODUCERooo 88 #define MIL_TBB_PRODUCER 88 #define MIL_TBB_PRODUCERuuu 89 89 90 90 #ifdef MIL_MALLOC_PRODUCER … … 124 124 #elif defined(MIL_TBB_PRODUCER) 125 125 #include <tbb/scalable_allocator.h> 126 #include <tbb/tbb_allocator.h> 126 127 namespace mil { 127 128 namespace pool { … … 129 130 char data[BLOCK_SIZE]; 130 131 }; 131 extern tbb::scalable_allocator<TbbMemoryUnit> tbb_allocator; 132 //extern tbb::scalable_allocator<TbbMemoryUnit> tbb_a; 133 extern tbb::tbb_allocator<TbbMemoryUnit> tbb_a; 132 134 class Producer { 133 135 public: … … 142 144 return ::malloc(BYTES); 143 145 } else { 144 return tbb_a llocator.allocate(blocks);146 return tbb_a.allocate(blocks); 145 147 } 146 148 } … … 165 167 ::free((void*)mem); 166 168 } else { 167 tbb_a llocator.deallocate((mil::pool::TbbMemoryUnit*)mem, blocks);169 tbb_a.deallocate((mil::pool::TbbMemoryUnit*)mem, blocks); 168 170 } 169 171 } … … 270 272 271 273 enum { 272 MAX_STORES = 30,274 MAX_STORES = 50, 273 275 }; 274 276 … … 291 293 template <class T> 292 294 void store(T* memory) { 293 int owner_id = memory->owner_id;294 MemoryList* l = (MemoryList*)memory;295 295 size_t blocks = pool::bytes_to_blocks(return_memory_considered_sizeof<T>()); 296 l->blocks = blocks;297 298 296 if (blocks > (size_t)MALLOC_BLOCKS_THESHOLD) { 299 297 #ifdef MIL_DEBUG_PRODUCER … … 304 302 } 305 303 304 int owner_id = memory->owner_id; 305 MemoryList* l = (MemoryList*)memory; 306 l->blocks = blocks; 306 307 l->next = heads[owner_id]; 307 308 heads[owner_id] = l; -
lang/objective-cplusplus/i3/trunk/src/mil/include/mil/StaticData.cpp
r34952 r35100 18 18 namespace mil { 19 19 #ifdef MIL_TBB_PRODUCER 20 #ifdef _MSC_VER 21 #ifdef _DEBUG 22 #pragma comment(lib, "ix86/tbb_debug.lib") 23 #else 24 #pragma comment(lib, "ix86/tbb.lib") 25 #endif 26 #endif 20 27 namespace pool { 21 tbb::scalable_allocator<TbbMemoryUnit> tbb_allocator; 28 //tbb::scalable_allocator<TbbMemoryUnit> tbb_a; 29 tbb::tbb_allocator<TbbMemoryUnit> tbb_a; 22 30 } 23 31 #endif -
lang/objective-cplusplus/i3/trunk/src/mil/src/Test1.cpp
r34940 r35100 3 3 #include <mil/GuiModule.h> 4 4 #include <mil/Thread.h> 5 6 #if defined(MIL_GUI_WINDOWS)7 # include <mil/gui-windows/GuiModule.h>8 #elif defined(MIL_GUI_COCOA)9 # include <mil/gui-cocoa/GuiModule.h>10 #else11 # include <mil/gui-cocoa/GuiModule.h>12 #endif13 14 5 #include <quicktest/quicktest.h> 15 6 #include "Test.h" -
lang/objective-cplusplus/i3/trunk/src/mil/src/Test11.cpp
r35077 r35100 6 6 7 7 #include "Test.h" 8 9 #define MIL_PROFILE10 8 11 9 using namespace mil; … … 38 36 39 37 // bench class 40 const unsigned int POST_MAX = 90000 00;38 const unsigned int POST_MAX = 90000; 41 39 const unsigned int NUM_THREADS = 19; 42 40 … … 152 150 #endif 153 151 } 152 //while (true) { 153 // Sleep(100000); 154 //} 154 155 } 155 156 -
lang/objective-cplusplus/i3/trunk/src/os-windows/Os.cpp
r35077 r35100 206 206 const TCHAR* get_config_dir() { 207 207 if (_tcsnlen(config_dir, _countof(config_dir)) == 0) { 208 return NULL; 208 init_config_dir(); 209 if (_tcsnlen(config_dir, _countof(config_dir)) == 0) { 210 return NULL; 211 } 209 212 } 210 213 return config_dir;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)