コード例 #1
0
ファイル: System.c プロジェクト: SOM-st/CSOM
void  _System_exit_(pVMObject object, pVMFrame frame) {
    pVMInteger err = (pVMInteger)SEND(frame, pop);
    int64_t err_no = SEND(err, get_embedded_integer);

    if (err_no != ERR_SUCCESS)
        SEND(frame, print_stack_trace);    
    Universe_exit((int32_t)err_no);
}
コード例 #2
0
static void print_usage_and_exit(const char* executable) {
    // print the usage
    fprintf(stderr, "Usage: %s [-options] [args...]\n\n", executable);
    fprintf(stderr, "where options include:\n");
    fprintf(stderr, "    -cp <directories separated by %s>\n", path_separator);
    fprintf(stderr, "        set search path for application classes\n");
    fprintf(stderr, "    -d  enable disassembling (twice for tracing)\n");
    fprintf(stderr, "    -g  enable garbage collection details:\n" \
                    "        1x - print statistics when VM shuts down\n" \
                    "        2x - print statistics upon each collection\n" \
                    "        3x - print statistics and dump heap upon each " \
                    "collection\n");
    fprintf(stderr, "    -Hx set the heap size to x MB (default: 1 MB)\n");
    fprintf(stderr, "    -h  show this help\n");
    // exit
    Universe_exit(ERR_SUCCESS);
}