Percona-Lab / pg_tde

MIT License
107 stars 19 forks source link

PG-1039 Fix arguments order in palloc_aligned #289

Closed artemgavrilov closed 6 days ago

artemgavrilov commented 1 week ago

https://perconadev.atlassian.net/browse/PG-1039

/*
 * palloc_aligned
 *      Allocate 'size' bytes returning a pointer that's aligned to the
 *      'alignto' boundary.
 *
 * Currently, we align addresses by requesting additional bytes from the
 * MemoryContext's standard allocator function and then aligning the returned
 * address by the required alignment.  This means that the given MemoryContext
 * must support providing us with a chunk of memory that's larger than 'size'.
 * For allocators such as Slab, that's not going to work, as slab only allows
 * chunks of the size that's specified when the context is created.
 *
 * 'alignto' must be a power of 2.
 * 'flags' may be 0 or set the same as MemoryContextAllocExtended().
 */
void *
palloc_aligned(Size size, Size alignto, int flags)
github-actions[bot] commented 1 week ago

Performance test results: Normal queries: 9715 TDE queries: 8971 Percentage: 92%