Fix memory allocation error when request size is near MaxAllocSize
palloc and repalloc will check request size is under MaxAllocSize, but the implementation(AllocSetAllocImpl, AllocSetReallocImpl) allocs ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ more bytes to store block information. Later MemoryContextNoteAlloc is called with block size. If palloc request size is between MaxAllocSize - (ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ) and MaxAllocSize, an internal error occurs. Fix: simply remove those assertions, the calculations in MemoryContextNoteAlloc and MemoryContextNoteFree should work with larger values. This resolves https://github.com/greenplum-db/gpdb/issues/1090. Signed-off-by: NPeifeng Qiu <pqiu@pivotal.io> Signed-off-by: NYuan Zhao <yuzhao@pivotal.io>
Showing
想要评论请 注册 或 登录