mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 03:50:16 +00:00
Update memory.h
Update frame.h Update frame.h
This commit is contained in:
parent
12e07391ee
commit
d4775a7016
@ -6,7 +6,7 @@
|
||||
|
||||
namespace pkpy{
|
||||
|
||||
static THREAD_LOCAL uint64_t kFrameGlobalId = 0;
|
||||
static THREAD_LOCAL i64 kFrameGlobalId = 0;
|
||||
|
||||
using ValueStack = pod_vector<PyObject*>;
|
||||
|
||||
@ -19,7 +19,7 @@ struct Frame {
|
||||
PyObject* _module;
|
||||
NameDict_ _locals;
|
||||
NameDict_ _closure;
|
||||
const uint64_t id;
|
||||
const i64 id;
|
||||
std::vector<std::pair<int, ValueStack>> s_try_block;
|
||||
|
||||
NameDict& f_locals() noexcept { return _locals!=nullptr ? *_locals : _module->attr(); }
|
||||
|
@ -223,7 +223,6 @@ struct MemoryPool{
|
||||
if(empty()) throw std::runtime_error("Arena::alloc() called on empty arena");
|
||||
#endif
|
||||
_free_list_size--;
|
||||
if(_free_list_size == 0) dirty = true;
|
||||
return _free_list[_free_list_size];
|
||||
}
|
||||
|
||||
@ -260,6 +259,7 @@ struct MemoryPool{
|
||||
void* p = arena->alloc()->data;
|
||||
if(arena->empty()){
|
||||
_arenas.pop_back();
|
||||
arena->dirty = true;
|
||||
_empty_arenas.push_back(arena);
|
||||
}
|
||||
return p;
|
||||
|
Loading…
x
Reference in New Issue
Block a user