// Get returns the current basic memory information.
4783
func (prof *Profiler) Get() (inf *Info, err error) {
	var (
		i, pos, nameLen int
		v               byte
		n               uint64
	)
	err = prof.Reset()
	if err != nil {
		return nil, err
	}
	inf = &Info{}
	inf.Timestamp = time.Now().UTC().UnixNano()
	for {
		prof.Val = prof.Val[:0]
		prof.Line, err = prof.ReadSlice('\n')
		if err != nil {
			if err == io.EOF {
				break
			}
			return inf, &joe.ReadError{Err: err}
		}
		// first grab the key name (everything up to the ':')
		for i, v = range prof.Line {
			if v == ':' {
				pos = i + 1
				break
			}
			prof.Val = append(prof.Val, v)
		}
		nameLen = len(prof.Val)

		// skip all spaces
		for i, v = range prof.Line[pos:] {
			if v != ' ' {
				pos += i
				break
			}
		}

		// grab the numbers
		for _, v = range prof.Line[pos:] {
			if v == ' ' || v == '\n' {
				break
			}
			prof.Val = append(prof.Val, v)
		}
		// any conversion error results in 0
		n, err = helpers.ParseUint(prof.Val[nameLen:])
		if err != nil {
			return inf, &joe.ParseError{Info: string(prof.Val[:nameLen]), Err: err}
		}

		v = prof.Val[0]
		// evaluate the key
		if v == 'A' {
			if prof.Val[5] == 'e' && nameLen == 6 {
				inf.Active = n
			}
			continue
		}
		if v == 'I' {
			if nameLen == 8 {
				inf.Inactive = n
			}
			continue
		}
		if v == 'M' {
			v = prof.Val[3]
			if nameLen < 8 {
				if v == 'p' {
					inf.Mapped = n
					continue
				}
				if v == 'F' {
					inf.MemFree = n
				}
				continue
			}
			if v == 'A' {
				inf.MemAvailable = n
				continue
			}
			inf.MemTotal = n
			continue
		}
		if v == 'S' {
			v = prof.Val[1]
			if v == 'w' {
				if prof.Val[4] == 'C' {
					inf.SwapCached = n
					continue
				}
				if prof.Val[4] == 'F' {
					inf.SwapFree = n
					continue
				}
				inf.SwapTotal = n
				continue
			}
		}
	}
	return inf, nil
}
620655
func (m *MemoryManager) Get(id string) (Policy, error) {
	m.RLock()
	defer m.RUnlock()
	p, ok := m.Policies[id]
	if !ok {
		return nil, errors.New("Not found")
	}

	return p, nil
}
1029334
func (rl *MemoryReplayLog) Get(hash *HashPrefix) (uint32, error) {
	if rl.entries == nil || rl.batches == nil {
		return 0, errReplayLogNotStarted
	}

	cltv, exists := rl.entries[*hash]
	if !exists {
		return 0, ErrLogEntryNotFound
	}

	return cltv, nil
}
1072878
func (c *Cache) Get(key string) (resp []byte, ok bool) {
	key = keyToFilename(key)
	resp, err := c.d.Read(key)
	if err != nil {
		return []byte{}, false
	}
	return resp, true
}
634409
func (c *InMemoryCache) Get(_ context.Context, key Key) (Thunk, bool) {
	c.mu.RLock()
	defer c.mu.RUnlock()

	item, found := c.items[key.String()]
	if !found {
		return nil, false
	}

	return item, true
}
176432
func (c *LRU) Get(base int64) bgzf.Block {
	c.mu.Lock()
	defer c.mu.Unlock()

	n, ok := c.table[base]
	if !ok {
		return nil
	}
	remove(n, c.table)
	return n.b
}
649889
func (mem *Memory) Get(key string) interface{} {
	if ret, ok := mem.data[key]; ok {
		if ret.Expired.Before(time.Now()) {
			mem.deleteKey(key)
			return nil
		}
		return ret.Data
	}
	return nil
}
580121
func (s *memcachedStorage) Get(key string) (interface{}, error) {
	memcachedItem, err := s.c.Get(key)
	if err != nil && err.Error() == "memcache: cache miss" {
		return nil, ErrCacheItemNotFound
	}

	if err != nil {
		return nil, err
	}

	item := &cachedItem{}

	err = decodeGob(memcachedItem.Value, item)
	if err != nil {
		return nil, err
	}

	return item.Val, nil
}
184505
func (bp *BufferPool) Get() *bytes.Buffer {
	return bp.pool.Get().(*bytes.Buffer)
}
65561
func (r *MemoryTTL) Get(key string) (interface{}, error) {
	r.RLock()

	for !r.isValid(key) {
		r.RUnlock()
		// Need write lock to delete key, so need to unlock, relock and recheck
		r.Lock()
		if !r.isValid(key) {
			r.delete(key)
			r.Unlock()
			return nil, ErrNotFound
		}
		r.Unlock()
		// Could become invalid again in this window
		r.RLock()
	}

	defer r.RUnlock()

	value, err := r.cache.Get(key)
	if err != nil {
		return nil, err
	}

	return value, nil
}
399585
func (bp *BytePoolCap) Get() (b []byte) {
	select {
	case b = <-bp.c:
	// reuse existing buffer
	default:
		// create new buffer
		if bp.wcap > 0 {
			b = make([]byte, bp.w, bp.wcap)
		} else {
			b = make([]byte, bp.w)
		}
	}
	return
}
1238499
func (m *MemStore) Get(key string) io.Reader {
	return &memStoreReader{store: m, key: key}
}
209017
func (c *Cache) Get(ctx context.Context, key storage.CacheKey) ([]byte, bool) {
	c.mu.Lock()
	defer c.mu.Unlock()

	v, ok := c.cacheMap[key]
	return v, ok
}
1106795
func (bp *BufferPool) Get() (b *bytes.Buffer) {
	select {
	case b = <-bp.c:
	// reuse existing buffer
	default:
		// create new buffer
		b = bytes.NewBuffer([]byte{})
	}
	return
}
1102539
func (c *randomEvictedCache) Get(key Measurable) (data Measurable, ok bool) {
	c.mu.RLock()
	defer c.mu.RUnlock()
	memoized, ok := c.data[key]
	if !ok {
		return nil, false
	}
	return memoized.m, ok
}
72933
func (c *MemoryCacher) Get(key string) interface{} {
	c.lock.RLock()
	defer c.lock.RUnlock()

	item, ok := c.items[key]
	if !ok {
		return nil
	}
	if item.hasExpired() {
		go c.Delete(key)
		return nil
	}
	return item.val
}
80951
func (c Cache) Get(k interface{}) (interface{}, bool) {
	v, ok := c[k]
	return v, ok
}