mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
limits the api of c
when PK_ENABLE_OS=0
This commit is contained in:
parent
54cd6ce756
commit
a4c3f67fb0
@ -272,6 +272,7 @@ namespace pkpy{
|
||||
void add_module_c(VM* vm){
|
||||
PyObject* mod = vm->new_module("c");
|
||||
|
||||
#if PK_ENABLE_OS
|
||||
vm->bind_func<1>(mod, "malloc", [](VM* vm, ArgsView args){
|
||||
i64 size = CAST(i64, args[0]);
|
||||
return VAR(malloc(size));
|
||||
@ -310,6 +311,7 @@ void add_module_c(VM* vm){
|
||||
memcpy(dst, src, size);
|
||||
return vm->None;
|
||||
});
|
||||
#endif
|
||||
|
||||
VoidP::register_class(vm, mod);
|
||||
C99Struct::register_class(vm, mod);
|
||||
|
Loading…
x
Reference in New Issue
Block a user