Skip to content

Commit a7cc982

Browse files
committed
more pointer implementation
1 parent c3ed002 commit a7cc982

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

vm/src/stdlib/ctypes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub fn extend_module_nodes(vm: &VirtualMachine, module: &Py<PyModule>) {
2222
"_SimpleCData" => PyCSimple::make_class(ctx),
2323
"Array" => array::PyCArray::make_class(ctx),
2424
"CFuncPtr" => function::PyCFuncPtr::make_class(ctx),
25+
"PyCPointerType" => pointer::PyCPointerType::make_class(ctx),
2526
"_Pointer" => pointer::PyCPointer::make_class(ctx),
2627
"_pointer_type_cache" => ctx.new_dict(),
2728
"Structure" => structure::PyCStructure::make_class(ctx),

vm/src/stdlib/ctypes/pointer.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
#[pyclass(name = "Pointer", module = "_ctypes")]
1+
#[pyclass(name = "PyCPointerType", base = "PyType", module = "_ctypes")]
2+
#[derive(PyPayload)]
3+
pub struct PyCPointerType {
4+
pub(super) inner: PyCPointer,
5+
}
6+
7+
#[pyclass(name = "_Pointer", base = "PyCData", metaclass = "PyCPointerType", module = "_ctypes")]
28
pub struct PyCPointer {}
39

410
#[pyclass(flags(BASETYPE, IMMUTABLETYPE))]

0 commit comments

Comments
 (0)