如下所示, 是NDK 中 STLPort库中的 basic_string的 M_allocate_block 函数

void __fastcall M_allocate_block(stlp_string *this, int len)
{
  stlp_string *v2; // r4
  STLP_alloc_proxy *pbuf; // r0
  int _len; // r3
  int len_; // [sp+4h] [bp-Ch]

  len_ = len;
  v2 = this;
  if ( len )
  {
    if ( (unsigned int)len > 0x10 )
    {
      len_ = len;
      if ( (unsigned int)len <= 0x80 )
        pbuf = (STLP_alloc_proxy *)std::__node_alloc::_M_allocate((std::__node_alloc *)&len_, (unsigned int *)len);
      else
        pbuf = (STLP_alloc_proxy *)operator new(len);
      _len = len_;
      v2->_M_start_of_storage = pbuf;
      v2->_M_finish = (char *)pbuf;
      v2->_M_buffers._M_end_of_storage = (char *)pbuf + _len;
    }
  }
  else
  {
    std::__stl_throw_length_error("basic_string");
  }
}

转载请注明转自: 听风 , 本文固定链接: 常见函数识别