MCPcopy Create free account
hub / github.com/Tencent/libco / set

Method set

co_epoll.cpp:87–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 return 0;
86 }
87 inline int set( int fd,const void * ptr )
88 {
89 int idx = fd / row_size;
90 if( idx < 0 || idx >= sizeof(m_pp)/sizeof(m_pp[0]) )
91 {
92 assert( __LINE__ == 0 );
93 return -__LINE__;
94 }
95 if( !m_pp[ idx ] )
96 {
97 m_pp[ idx ] = (void**)calloc( 1,sizeof(void*) * col_size );
98 }
99 m_pp[ idx ][ fd % col_size ] = (void*)ptr;
100 return 0;
101 }
102 inline void *get( int fd )
103 {
104 int idx = fd / row_size;

Callers 1

co_epoll_ctlFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected