Lines Matching refs:shift
57 int *ptr, shift; in PetscMallocAlign() local
67 shift = (int)(((PETSC_UINTPTR_T)ptr) % PETSC_MEMALIGN); in PetscMallocAlign()
68 shift = (2 * PETSC_MEMALIGN - shift) / sizeof(int); in PetscMallocAlign()
69 ptr[shift - 1] = shift + SHIFT_CLASSID; in PetscMallocAlign()
70 ptr += shift; in PetscMallocAlign()
91 const int shift = *((int *)ptr - 1) - SHIFT_CLASSID; in PetscFreeAlign() local
93 …PetscCheck(shift <= PETSC_MEMALIGN - 1, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Likely memory corruption… in PetscFreeAlign()
94 PetscCheck(shift >= 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Likely memory corruption in heap"); in PetscFreeAlign()
95 ptr = (void *)((int *)ptr - shift); in PetscFreeAlign()
125 int shift = *(((int *)*result) - 1) - SHIFT_CLASSID; in PetscReallocAlign() local
126 …PetscCheck(shift <= PETSC_MEMALIGN - 1, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Likely memory corruption… in PetscReallocAlign()
127 PetscCheck(shift >= 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Likely memory corruption in heap"); in PetscReallocAlign()
128 *result = (void *)(((int *)*result) - shift); in PetscReallocAlign()
141 int shift = (int)(((PETSC_UINTPTR_T)ptr) % PETSC_MEMALIGN); in PetscReallocAlign() local
142 shift = (2 * PETSC_MEMALIGN - shift) / sizeof(int); in PetscReallocAlign()
143 ptr[shift - 1] = shift + SHIFT_CLASSID; in PetscReallocAlign()
144 ptr += shift; in PetscReallocAlign()