This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void* malloc(size_t size_byte) { | |
| size_t size = size_byte * 8; | |
| Dlinked_list_node lst = mem_manager->mem_lst; | |
| Memory_info* mi = lst->data; | |
| while (lst->tail != DUMMY) { | |
| if (mi->state == MEM_INFO_STATE_FREE && size < mi->size) { | |
| break; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum memory_manager_constants { | |
| MAX_MEM_NODE_NUM = 4096, | |
| MEM_INFO_STATE_LOST = -1, | |
| MEM_INFO_STATE_FREE, | |
| MEM_INFO_STATE_ALLOC, | |
| }; | |
| /* 管理対象のメモリ情報 */ | |
| struct memory_info { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Segment_descriptor *gdt = (Segment_descriptor*)0x270000; | |
| /* 全セグメントを初期化 */ | |
| for (int i = 0; i < GDT_MAX_NUM; ++i) { | |
| set_segment_descriptor(gdt + i, 0, 0, 0, 0, 0, 0, 0, 0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let ps = vimproc#popen3('path/to/t_sample') | |
| call ps.stdin.write('write_test!') | |
| call ps.stdin.close() | |
| " close無しだと以下のreadで空 | |
| let output = ps.stdout.read() | |
| echomsg " 2 stdout echos " . output | |
| " finish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(void) { | |
| char buf[100]; | |
| printf("mopp test\n"); | |
| fflush(stdout); | |
| scanf("%s", buf); | |
| printf("%s\n", buf); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Installation | |
| " NeoBundle 'gist:mopp/6590603', { 'name': 'inOne.vim', 'script_type': 'plugin'} | |
| let s:buf_name = 'AllInOne' | |
| let s:signature = '=====DELIMITER=====' | |
| function! s:write() | |
| " echomsg 'call write' | |
| call cursor(1, 0) | |
| let now_line = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ の行はターミナルで実行するコマンドです | |
| まずcygwin内でvimを起動し.vimrcを作成 | |
| $ vim ~/.vimrc | |
| 以下の囲われている所をコピペ | |
| -------------------------------------------------- | |
| set nocompatible " Be iMproved | |
| if has('vim_starting') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let lst = [ ['<', "smartchr#loop(' < ', ' << ', '<')" ], | |
| \ ['>', "smartchr#loop(' > ', ' >> ', ' >>> ', '>')"], | |
| \ ['+', "smartchr#loop(' + ', ' ++ ', '+')"], | |
| \ ['-', "smartchr#loop(' - ', ' -- ', '-')"], | |
| \ ['/', "smartchr#loop(' / ', '//', '/')"], | |
| \ ['&', "smartchr#loop(' & ', ' && ', '&')"], | |
| \ ['%', "smartchr#loop(' % ', '%')"], | |
| \ ['*', "smartchr#loop(' * ', '*')"], | |
| \ ['<Bar>', "smartchr#loop(' | ', ' || ', '|')"], | |
| \ [',', "smartchr#loop(', ', ',')"]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NeoBundle 'Shougo/neosnippet' | |
| “インサートモードのマッピング | |
| imap <C-k> <Plug>(neosnippet_expand_or_jump) | |
| smap <C-k> <Plug>(neosnippet_expand_or_jump) | |
| set conceallevel=2 concealcursor=i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| “ NeoComplete | |
| NeoBundle 'Shougo/neocomplete.vim' | |
| NeoBundle 'Shougo/context_filetype.vim' | |
| let g:neocomplete#enable_at_startup = 1 | |
| “ NeoComplCache | |
| NeoBundle 'Shougo/neocomplcache' | |
| let g:neocomplcache_enable_at_startup = 1 |