proxygen
folly::CoreRawAllocator< Stripes > Class Template Reference

#include <CacheLocality.h>

Classes

class  Allocator
 

Public Member Functions

Allocatorget (size_t stripe)
 

Private Attributes

Allocator allocators_ [Stripes]
 

Detailed Description

template<size_t Stripes>
class folly::CoreRawAllocator< Stripes >

An allocator that can be used with CacheLocality to allocate core-local memory.

There is actually nothing special about the memory itself (it is not bound to numa nodes or anything), but the allocator guarantees that memory allocatd from the same stripe will only come from cache lines also allocated to the same stripe. This means multiple things using CacheLocality can allocate memory in smaller-than cacheline increments, and be assured that it won't cause more false sharing than it otherwise would.

Note that allocation and deallocation takes a per-sizeclass lock.

Definition at line 456 of file CacheLocality.h.

Member Function Documentation

template<size_t Stripes>
Allocator* folly::CoreRawAllocator< Stripes >::get ( size_t  stripe)
inline

Definition at line 511 of file CacheLocality.h.

Referenced by TEST().

511  {
512  assert(stripe < Stripes);
513  return &allocators_[stripe];
514  }
Allocator allocators_[Stripes]

Member Data Documentation

template<size_t Stripes>
Allocator folly::CoreRawAllocator< Stripes >::allocators_[Stripes]
private

Definition at line 517 of file CacheLocality.h.


The documentation for this class was generated from the following file: