You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/04/09 11:39:47 UTC
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #1890: feat(bindings/c): free, limit operation and tests
Xuanwo commented on code in PR #1890:
URL: https://github.com/apache/incubator-opendal/pull/1890#discussion_r1161271098
##########
bindings/c/tests/basicio.c:
##########
Review Comment:
Remove this test please. At current stage, we only need to implement BDD tests as defined in https://github.com/apache/incubator-opendal/tree/main/bindings/tests
##########
bindings/c/src/lib.rs:
##########
@@ -72,6 +72,41 @@ pub unsafe extern "C" fn opendal_operator_new(scheme: *const c_char) -> opendal_
opendal_operator_ptr::from(op)
}
+/// Free the allocated operator pointed by [`opendal_operator_ptr`]
+#[no_mangle]
+pub extern "C" fn opendal_operator_free(op_ptr: opendal_operator_ptr) {
+ let _ = unsafe { Box::from_raw(op_ptr.get_ref_mut()) };
+ // dropped
+}
+
+/// Get current operator's limit
+#[no_mangle]
+pub extern "C" fn opendal_operator_limit_get(op_ptr: opendal_operator_ptr) -> usize {
Review Comment:
Please don't expose those API before we have a working binding. Keep simple and force.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org