2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * The break must always be at least 8-byte aligned 2N/A return ((
void *)-
1);
2N/A * _sbrk_unlocked() aligns the old break, adds the addend, aligns 2N/A * the new break, and calls _brk_unlocked() to set the new break. 2N/A * We must align the old break because _nd may begin life misaligned. 2N/A * The addend can be either positive or negative, so there are two 2N/A * - the addend is negative and brk + addend < 0. 2N/A * - the addend is positive and brk + addend > ULONG_MAX 2N/A * Start of the data segment hasn't been calculated yet. 2N/A * Use brk(0) to gather it from the kernel. 2N/A return ((
void *)-
1);
2N/A return ((
void *)-
1);
2N/A * _sbrk_grow_aligned() aligns the old break to a low_align boundry, 2N/A * adds min_size, aligns to a high_align boundry, and calls _brk_unlocked() 2N/A * to set the new break. The low_aligned-aligned value is returned, and 2N/A * the actual space allocated is returned through actual_size. 2N/A * Unlike sbrk(2), _sbrk_grow_aligned takes an unsigned size, and does 2N/A * not allow shrinking the heap. 2N/A return ((
void *)-
1);
2N/A return ((
void *)-
1);
2N/A * Start of the data segment hasn't been calculated yet. 2N/A * Use brk(0) to gather it from the kernel. 2N/A * Check for overflow 2N/A return ((
void *)-
1);
2N/A return ((
void *)-
1);
2N/A * Return what a call to brk(0) not going through the special path 2N/A * Need to align this here; _brk_unlocked won't do it for us.