Closed lolriven closed 5 years ago
us_whatever_ext returns the extension of whatever. All constructors take ext_size, so if you do not wish to store all of your extension directly along the rest of whatever, you give it sizeof(void *) for ext_size and interpret us_whatever_ext as void **.
Extension in this context means user data.
Hello, I'm slightly confused about what
us_socket_ext
is doing. Is it allocating memory internally for the size relative to the context structure and returning the newly allocated pointer? Because what I'd like to do is store the socket objects in a class object, but I'd like us_socket_t to be able to reference that object later on. Like a->data
field. Doesus_socket_t
have a data field I can use or something to reference its parent object. Isus_socket_ext
meant to return the class object pointer whichus_socket_t
is supposed to be stored in?