Skip to content

Commit

Permalink
Fast functors
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Sep 10, 2023
1 parent 6292275 commit e732af4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/momo/UserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
// If your platform does not require data alignment, define it as `1`
#define MOMO_MAX_ALIGNMENT alignof(std::max_align_t)

#define MOMO_MAX_FAST_FUNCTOR_SIZE (sizeof(void*) * 2)

// Memory pool settings
#define MOMO_DEFAULT_MEM_POOL_BLOCK_COUNT 32
#define MOMO_DEFAULT_MEM_POOL_CACHED_FREE_BLOCK_COUNT 16
Expand Down
3 changes: 2 additions & 1 deletion include/momo/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ namespace internal
static_assert(std::has_single_bit(maxAllocAlignment));
static_assert(maxAllocAlignment % maxAlignment == 0);

static const size_t maxFastFunctorSize = 2 * sizeof(void*); //?
static const size_t maxFastFunctorSize = MOMO_MAX_FAST_FUNCTOR_SIZE;
//static_assert(maxFastFunctorSize >= sizeof(void*));

static const size_t maxSize = SIZE_MAX;

Expand Down

0 comments on commit e732af4

Please sign in to comment.