diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-01 23:30:53 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-07 20:33:00 +0000 |
commit | b4b10fd350852e321624d74983cca286091b55a1 (patch) | |
tree | 7ac4aa40d70be0170a61f649e9d73c42faa4ba33 /py/mpstate.c | |
parent | ad2307c92c15f0aa90dbd0741fd2538719d0b5e1 (diff) |
py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place,
in a global structure. Root pointers are all located together to make
GC tracing easier and more efficient.
Diffstat (limited to 'py/mpstate.c')
-rw-r--r-- | py/mpstate.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/py/mpstate.c b/py/mpstate.c new file mode 100644 index 000000000..2ba3402ef --- /dev/null +++ b/py/mpstate.c @@ -0,0 +1,29 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mpstate.h" + +mp_state_ctx_t mp_state_ctx; |