Skip to content
  • Faith Ekstrand's avatar
    Clean up and refactor wl_closure and associated functions · 2fc248dc
    Faith Ekstrand authored
    
    
    The primary purpose of this patch is to clean up wl_closure and separate
    closure storage, libffi, and the wire format.  To that end, a number of changes
    have been made:
    
     - The maximum number of closure arguments has been changed from a magic number
       to a #define WL_CLOSURE_MAX_ARGS
    
     - A wl_argument union has been added for storing a generalized closure
       argument and wl_closure has been converted to use wl_argument instead of the
       combination of libffi, the wire format, and a dummy extra buffer.  As of
       now, the "extra" field in wl_closure should be treated as bulk storage and
       never direclty referenced outside of wl_connection_demarshal.
    
     - Everything having to do with libffi has been moved into wl_closure_invoke
       and the convert_arguments_to_ffi helper function.
    
     - Everything having to do with the wire format has been restricted to
       wl_connection_demarshal and the new static serialize_closure function.  The
       wl_closure_send and wl_closure_queue functions are now light wrappers around
       serialize_closure.
    
    Signed-off-by: default avatarJason Ekstrand <jason@jlekstrand.net>
    2fc248dc