diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index 17212f8d37d..2570364e6c1 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -787,7 +787,7 @@ verify (INT_MAX <= PTRDIFF_MAX); | |||
| 787 | void * | 787 | void * |
| 788 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | 788 | xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) |
| 789 | { | 789 | { |
| 790 | xassert (0 <= nitems && 0 < item_size); | 790 | eassert (0 <= nitems && 0 < item_size); |
| 791 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) | 791 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) |
| 792 | memory_full (SIZE_MAX); | 792 | memory_full (SIZE_MAX); |
| 793 | return xmalloc (nitems * item_size); | 793 | return xmalloc (nitems * item_size); |
| @@ -800,7 +800,7 @@ xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) | |||
| 800 | void * | 800 | void * |
| 801 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) | 801 | xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) |
| 802 | { | 802 | { |
| 803 | xassert (0 <= nitems && 0 < item_size); | 803 | eassert (0 <= nitems && 0 < item_size); |
| 804 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) | 804 | if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) |
| 805 | memory_full (SIZE_MAX); | 805 | memory_full (SIZE_MAX); |
| 806 | return xrealloc (pa, nitems * item_size); | 806 | return xrealloc (pa, nitems * item_size); |
| @@ -850,7 +850,7 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min, | |||
| 850 | ptrdiff_t nitems_incr_max = n_max - n; | 850 | ptrdiff_t nitems_incr_max = n_max - n; |
| 851 | ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); | 851 | ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); |
| 852 | 852 | ||
| 853 | xassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max); | 853 | eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max); |
| 854 | if (! pa) | 854 | if (! pa) |
| 855 | *nitems = 0; | 855 | *nitems = 0; |
| 856 | if (nitems_incr_max < incr) | 856 | if (nitems_incr_max < incr) |
| @@ -2220,7 +2220,7 @@ compact_small_strings (void) | |||
| 2220 | for (b = oldest_sblock; b; b = b->next) | 2220 | for (b = oldest_sblock; b; b = b->next) |
| 2221 | { | 2221 | { |
| 2222 | end = b->next_free; | 2222 | end = b->next_free; |
| 2223 | xassert ((char *) end <= (char *) b + SBLOCK_SIZE); | 2223 | eassert ((char *) end <= (char *) b + SBLOCK_SIZE); |
| 2224 | 2224 | ||
| 2225 | for (from = &b->first_data; from < end; from = from_end) | 2225 | for (from = &b->first_data; from < end; from = from_end) |
| 2226 | { | 2226 | { |
| @@ -2271,7 +2271,7 @@ compact_small_strings (void) | |||
| 2271 | /* Copy, and update the string's `data' pointer. */ | 2271 | /* Copy, and update the string's `data' pointer. */ |
| 2272 | if (from != to) | 2272 | if (from != to) |
| 2273 | { | 2273 | { |
| 2274 | xassert (tb != b || to < from); | 2274 | eassert (tb != b || to < from); |
| 2275 | memmove (to, from, nbytes + GC_STRING_EXTRA); | 2275 | memmove (to, from, nbytes + GC_STRING_EXTRA); |
| 2276 | to->string->data = SDATA_DATA (to); | 2276 | to->string->data = SDATA_DATA (to); |
| 2277 | } | 2277 | } |