main.cc (13620:e0d9b09788f6) | main.cc (13662:3e072654ca86) |
---|---|
1/* 2 * Copyright (c) 2008 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 40 unchanged lines hidden (view full) --- 49 std::unique_ptr<wchar_t[], decltype(&PyMem_RawFree)> program( 50 Py_DecodeLocale(argv[0], NULL), 51 &PyMem_RawFree); 52 Py_SetProgramName(program.get()); 53#else 54 Py_SetProgramName(argv[0]); 55#endif 56 | 1/* 2 * Copyright (c) 2008 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 40 unchanged lines hidden (view full) --- 49 std::unique_ptr<wchar_t[], decltype(&PyMem_RawFree)> program( 50 Py_DecodeLocale(argv[0], NULL), 51 &PyMem_RawFree); 52 Py_SetProgramName(program.get()); 53#else 54 Py_SetProgramName(argv[0]); 55#endif 56 |
57 // Register native modules with Python's init system before 58 // initializing the interpreter. 59 registerNativeModules(); 60 |
|
57 // initialize embedded Python interpreter 58 Py_Initialize(); 59 60 // Initialize the embedded m5 python library | 61 // initialize embedded Python interpreter 62 Py_Initialize(); 63 64 // Initialize the embedded m5 python library |
61 ret = initM5Python(); | 65 ret = EmbeddedPython::initAll(); |
62 63 if (ret == 0) { 64 // start m5 65 ret = m5Main(argc, argv); 66 } 67 68 // clean up Python intepreter. 69 Py_Finalize(); 70 71 return ret; 72} | 66 67 if (ret == 0) { 68 // start m5 69 ret = m5Main(argc, argv); 70 } 71 72 // clean up Python intepreter. 73 Py_Finalize(); 74 75 return ret; 76} |