  
      def _realloc(self, new_size):
          self.max_length = new_size
          n = new_size + (PADDING * 2)
          self._lex_ptr = <const Lexeme**>self.mem.realloc(self._lex_ptr, n * sizeof(Lexeme*))
          self._idx_ptr = <int*>self.mem.realloc(self._idx_ptr, n * sizeof(int))
          self._pos_ptr = <int*>self.mem.realloc(self._pos_ptr, n * sizeof(int))
          self._ner_ptr = <int*>self.mem.realloc(self._ner_ptr, n * sizeof(int))
          self.lex = self._lex_ptr + PADDING
          self.idx = self._idx_ptr + PADDING
          self.pos = self._pos_ptr + PADDING
          self.ner = self._ner_ptr + PADDING
          for i in range(self.length, self.max_length + PADDING):
              self.lex[i] = &EMPTY_LEXEME
  
  
  @cython.freelist(64)
 
</s> remove         self._lex_ptr = <const Lexeme**>self.mem.alloc(size + (PADDING*2), sizeof(Lexeme*))
        self._idx_ptr = <int*>self.mem.alloc(size + (PADDING*2), sizeof(int))
        self._pos_ptr = <int*>self.mem.alloc(size + (PADDING*2), sizeof(int))
        self._ner_ptr = <int*>self.mem.alloc(size + (PADDING*2), sizeof(int))
        self.lex = self._lex_ptr
        self.idx = self._idx_ptr
        self.pos = self._pos_ptr
        self.ner = self._ner_ptr
 </s> add         self._data = <TokenC*>self.mem.alloc(size + (PADDING*2), sizeof(TokenC)) </s> remove             self.lex[i] = &EMPTY_LEXEME
        self.lex += PADDING
        self.idx += PADDING
        self.pos += PADDING
        self.ner += PADDING
 </s> add             self._data[i] = EMPTY_TOKEN
        self.data = self._data + PADDING </s> remove             attr = get_attr(self.lex[i], attr_id)
 </s> add             attr = get_attr(self.data[i].lex, attr_id) </s> remove         self.lex[self.length] = lexeme
        self.idx[self.length] = idx
        self.pos[self.length] = 0
        self.ner[self.length] = 0
 </s> add         cdef TokenC* t = &self.data[self.length]
        t.lex = lexeme
        t.idx = idx
        t.pos = 0
        t.sense = 0 </s> remove             lexemes[i] = tokens[i]
 </s> add             lexemes[i] = tokens[i].lex
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
  
      def _realloc(self, new_size):
          self.max_length = new_size
          n = new_size + (PADDING * 2)
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
        self._data = <TokenC*>self.mem.realloc(self._data, n * sizeof(TokenC))
        self.data = self._data + PADDING
        cdef int i
          for i in range(self.length, self.max_length + PADDING):
              self.lex[i] = &EMPTY_LEXEME
  
  
  @cython.freelist(64)
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 * Introduce a TokenC struct, to handle token indices, pos tags and sense tags 
spacy/tokens.pyx