diff options
author | 2019-10-18 17:57:55 +0200 | |
---|---|---|
committer | 2019-10-18 17:57:55 +0200 | |
commit | b09fa00cca1a9baa0327a33d865fc970f77d4db0 (patch) | |
tree | 47dd943368aa43a0c0cf4256f88e590960c1e99f /src/lib/netlist/plib/palloc.h | |
parent | ad27643c07d54fc2cc3e56327fe07335e7763d52 (diff) |
Netlist: code maintenance and improvements. [Couriersud]
- Added support for line markers to the preprocessor and parser.
- Added support for include processing to the preprocessor.
- Moved sources base type to plib to be used for preprocessor includes.
This enables to include e.g. from rom memory regions.
- Renamed some defines
Diffstat (limited to 'src/lib/netlist/plib/palloc.h')
-rw-r--r-- | src/lib/netlist/plib/palloc.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index 5b7d2f59c2d..aa1aac5544d 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -276,7 +276,7 @@ namespace plib { static inline void *allocate( size_t alignment, size_t size ) { - #if (USE_ALIGNED_ALLOCATION) + #if (PUSE_ALIGNED_ALLOCATION) #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) return _aligned_malloc(size, alignment); #elif defined(__APPLE__) @@ -296,7 +296,7 @@ namespace plib { static inline void deallocate( void *ptr ) { - #if (USE_ALIGNED_ALLOCATION) + #if (PUSE_ALIGNED_ALLOCATION) // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) free(ptr); #else @@ -352,7 +352,7 @@ namespace plib { //auto t = reinterpret_cast<std::uintptr_t>(p); //if (t & (ALIGN-1)) // printf("alignment error!"); -#if (USE_ALIGNED_HINTS) +#if (PUSE_ALIGNED_HINTS) return reinterpret_cast<T *>(__builtin_assume_aligned(p, ALIGN)); #else return p; @@ -364,7 +364,7 @@ namespace plib { { static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)"); static_assert(is_pow2(ALIGN), "Alignment must be a power of 2"); -#if (USE_ALIGNED_HINTS) +#if (PUSE_ALIGNED_HINTS) return reinterpret_cast<const T *>(__builtin_assume_aligned(p, ALIGN)); #else return p; |