You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/20 23:35:31 UTC

[GitHub] [tvm] areusch commented on a diff in pull request #10014: Fix function number datatype from char to uint16_t

areusch commented on code in PR #10014:
URL: https://github.com/apache/tvm/pull/10014#discussion_r854651226


##########
src/runtime/crt/common/func_registry.c:
##########
@@ -60,14 +60,20 @@ int strcmp_cursor(const char** cursor, const char* name) {
   return return_value;
 }
 
+uint16_t* TVMFuncRegistry_GetNumFuncs(const TVMFuncRegistry* reg) { return (uint16_t*)reg->names; }

Review Comment:
   for this function, i think we need to impl like this to avoid alignment problems:
   ```suggestion
   uint16_t TVMFuncRegistry_GetNumFuncs(const TVMFuncRegistry* reg) { 
     uint16_t num_funcs;
     memcpy(&num_funcs, reg->names, sizeof(num_funcs));
     return num_funcs;
     }
   ```



-- 
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@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org