Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/mty-makai/mty.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by chapuni, Thu Mar 1 14:32:05 2007 UTC revision 2 by chapuni, Fri Mar 2 07:03:17 2007 UTC
# Line 2  Line 2 
2   *   *
3   *      file: mty.cpp   *      file: mty.cpp
4   *   *
5   *      まあ、待て屋   *      まあ、待て屋。
6   *   *
7   *      $Id$   *      $Id$
8   *   *
# Line 20  Line 20 
20  #include <sys/timeb.h>  #include <sys/timeb.h>
21  #else  #else
22  #include <sys/mman.h>  #include <sys/mman.h>
 #include <sys/time.h>  
23  #endif  #endif
24    
25    #include <sys/time.h>
26  #include <assert.h>  #include <assert.h>
27  #include <ctype.h>  #include <ctype.h>
28  #include <stdio.h>  #include <stdio.h>
# Line 1253  main(int argc, char *argv[]) Line 1253  main(int argc, char *argv[])
1253    int i, j;    int i, j;
1254    int lc;    int lc;
1255    int mincnt;    int mincnt;
1256    signed char *code;    signed char *code = NULL;
1257    FILE *ofp;    FILE *ofp;
1258    int n_iter;    int n_iter;
1259    int cr;    int cr;
# Line 1305  main(int argc, char *argv[]) Line 1305  main(int argc, char *argv[])
1305                                                             PAGE_EXECUTE_READWRITE,                                                             PAGE_EXECUTE_READWRITE,
1306                                                             0, 0x20000000,                                                             0, 0x20000000,
1307                                                             NULL);                                                             NULL);
1308    assert(SUCCEEDED(h));    if (SUCCEEDED(h))
1309    code = (signed char *)MapViewOfFile(h,          code = (signed char *)MapViewOfFile(h,
1310                                                                            SECTION_MAP_EXECUTE | FILE_MAP_WRITE,                                                                                  SECTION_MAP_EXECUTE | FILE_MAP_WRITE,
1311                                                                            0, 0x10000000,                                                                                  0, 0x10000000,
1312                                                                            0);                                                                                  0);
1313    assert(code);  
1314  #else  #else
1315    code = (signed char *)mmap(NULL,    code = (signed char *)mmap(NULL,
1316                               0x10000000,                               0x10000000,
# Line 1318  main(int argc, char *argv[]) Line 1318  main(int argc, char *argv[])
1318                               MAP_PRIVATE | MAP_ANONYMOUS,                               MAP_PRIVATE | MAP_ANONYMOUS,
1319                               1, /* fd */                               1, /* fd */
1320                               0);                               0);
1321    if ((void *)code == MAP_FAILED) perror(argv[0]);    if ((void *)code == MAP_FAILED)
1322            code =NULL;
1323  #endif  #endif
1324    
1325      /* メモリが確保できていない場合のいんちき対策 */
1326      if (code == NULL)
1327            code = (signed char *)malloc(crypt64_end - crypt64_sta + 1024 * 1024);
1328      assert(code != NULL);
1329    
1330      /* Prologue を展開 */
1331    memcpy(code, crypt64_sta, crypt64_end - crypt64_sta);    memcpy(code, crypt64_sta, crypt64_end - crypt64_sta);
1332  #ifndef __GNUC__  #ifndef __GNUC__
1333    d_crypt64 = (CRYPT64_PP)code;    d_crypt64 = (CRYPT64_PP)code;
# Line 1526  main(int argc, char *argv[]) Line 1534  main(int argc, char *argv[])
1534    return 0;    return 0;
1535  }  }
1536    
1537  /* EOF */  /*
1538     *      Local Variables:
1539     *              tab-width:      4
1540     *      End:
1541     *
1542     * EOF */

Legend:
Removed from v.1  
changed lines
  Added in v.2

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26