Skip to content

Use of native size_t in the API #119

@sbc100

Description

@sbc100

Would it be better to avoid the native size_t type and use a fixed size wasi_size_t?

For example in the following API signature:

uvwasi_errno_t uvwasi_fd_write(uvwasi_t* uvwasi,                                                                              
                               uvwasi_fd_t fd,                                      
                               const uvwasi_ciovec_t* iovs,                      
                               size_t iovs_len,                                  
                               size_t* nwritten);   

In this case it would make sense to pass the actual address of the nwritten out param in the wasm memory. However since wasi's size_t is fixed at 4 bytes, we wouldn't want to write a 64-bit value into that location. It seems that on LP64 systems we uvwasi_fd_write would currently write 8 bytes. Maybe I'm misunderstanding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions