diff options
author | 2019-02-21 22:59:17 +0100 | |
---|---|---|
committer | 2019-02-22 08:18:01 +0100 | |
commit | cf73ccc764d574284bef4ce95ee5bc3e9089f053 (patch) | |
tree | 1655c2836b200c90d5fe5dd5833159e7e8be1522 /src/lib/netlist/plib/pconfig.h | |
parent | 6ed352261d40e37887357fe901dc380d6ef79844 (diff) |
netlist: memory management. [Couriersud]
Memory management in plib is now alignment-aware. All allocations
respect c++11 alignas. Selected classes like parray and aligned_vector
also provide hints (__builtin_assume_aligned) to g++ and clang.
The alignment optimizations have little impact on the current use cases.
They only become effective on bigger data processing.
What has a measurable impact is memory pooling. This speeds up netlist
games like breakout and pong by about 5%.
Tested with linux, macosx and windows cross builds. All features are
disabled since I can not rule out they may temporarily break more exotic
builds.
Diffstat (limited to 'src/lib/netlist/plib/pconfig.h')
-rw-r--r-- | src/lib/netlist/plib/pconfig.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h index cc92a42c827..9f61fc0b01f 100644 --- a/src/lib/netlist/plib/pconfig.h +++ b/src/lib/netlist/plib/pconfig.h @@ -34,11 +34,22 @@ #endif /* + * Set this to one if you want to use aligned storage optimizations. + */ + +#ifndef USE_ALIGNED_OPTIMIZATIONS +#define USE_ALIGNED_OPTIMIZATIONS (0) +#endif + +/* * Standard alignment macros */ -#define PALIGNAS_CACHELINE() PALIGNAS(64) -#define PALIGNAS_VECTOROPT() PALIGNAS(64) +#define PALIGN_CACHELINE (64) +#define PALIGN_VECTOROPT (16) + +#define PALIGNAS_CACHELINE() PALIGNAS(PALIGN_CACHELINE) +#define PALIGNAS_VECTOROPT() PALIGNAS(PALIGN_VECTOROPT) /* Breaks mame build on windows due to -Wattribute */ #if defined(_WIN32) && defined(__GNUC__) |