mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
b82e52df00
commit
5dbd198c32
@ -36,7 +36,7 @@ inline PyObject* VM::_run_top_frame(){
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if PK_ENABLE_CEVAL_CALLBACK
|
#if PK_ENABLE_CEVAL_CALLBACK
|
||||||
#define CEVAL_STEP() byte = frame->next_bytecode(); if(_ceval_on_step) _ceval_on_step(this, frame, byte)
|
#define CEVAL_STEP() byte = frame->next_bytecode(); if(_ceval_on_step) _ceval_on_step(this, frame.get(), byte)
|
||||||
#else
|
#else
|
||||||
#define CEVAL_STEP() byte = frame->next_bytecode()
|
#define CEVAL_STEP() byte = frame->next_bytecode()
|
||||||
#endif
|
#endif
|
||||||
|
22
src/config.h
22
src/config.h
@ -50,17 +50,19 @@
|
|||||||
// (not recommended to change this)
|
// (not recommended to change this)
|
||||||
#define PK_MAX_CO_VARNAMES 255
|
#define PK_MAX_CO_VARNAMES 255
|
||||||
|
|
||||||
// Hash table load factor (smaller ones mean less collision but more memory)
|
namespace pkpy{
|
||||||
// For class instance
|
// Hash table load factor (smaller ones mean less collision but more memory)
|
||||||
inline const float kInstAttrLoadFactor = 0.67f;
|
// For class instance
|
||||||
// For class itself
|
inline const float kInstAttrLoadFactor = 0.67f;
|
||||||
inline const float kTypeAttrLoadFactor = 0.5f;
|
// For class itself
|
||||||
|
inline const float kTypeAttrLoadFactor = 0.5f;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
inline const char kPlatformSep = '\\';
|
inline const char kPlatformSep = '\\';
|
||||||
#else
|
#else
|
||||||
inline const char kPlatformSep = '/';
|
inline const char kPlatformSep = '/';
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable:4267)
|
#pragma warning (disable:4267)
|
||||||
|
1
src/vm.h
1
src/vm.h
@ -98,6 +98,7 @@ struct FrameId{
|
|||||||
int index;
|
int index;
|
||||||
FrameId(std::vector<pkpy::Frame>* data, int index) : data(data), index(index) {}
|
FrameId(std::vector<pkpy::Frame>* data, int index) : data(data), index(index) {}
|
||||||
Frame* operator->() const { return &data->operator[](index); }
|
Frame* operator->() const { return &data->operator[](index); }
|
||||||
|
Frame* get() const { return &data->operator[](index); }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void(*PrintFunc)(VM*, const Str&);
|
typedef void(*PrintFunc)(VM*, const Str&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user