• Kirill Smelkov's avatar
    libgolang: _selcase: Introduce accessors to get pointers to for-send and for-recv data · 2590e9a7
    Kirill Smelkov authored
    In the next patch we are going to teach _selcase to support both
    external and inplace data. Before that let's do a couple of preparatory
    things.
    
    This patch: introduces .ptx() and .prx() accessors to get to
    corresponding data buffer associated with _selcase. Convert _selcase
    users to use .ptx() and .prx() instead of doing direct .ptxrx access.
    This way when we'll add inplace support to _selcase, we'll need to adapt
    only accessors, not clients.
    
    The only place that is left using .ptxrx directly is one tricky place in
    _chanselect2<onstack=false> where gevent-related code needs to carefully
    deal with proxying tx/rx buffers due to STACK_DEAD_WHILE_PARKED.
    
    NOTE even though new accessors may panic, libgolang.cpp always calls them
    after checking that the conditions for ptx/prx calls are valid.
    2590e9a7
libgolang.h 15 KB