Lines Matching refs:size2
86 static inline void *safe_malloc_add_2op_(size_t size1, size_t size2) in safe_malloc_add_2op_() argument
88 size2 += size1; in safe_malloc_add_2op_()
89 if(size2 < size1) in safe_malloc_add_2op_()
91 return safe_malloc_(size2); in safe_malloc_add_2op_()
94 static inline void *safe_malloc_add_3op_(size_t size1, size_t size2, size_t size3) in safe_malloc_add_3op_() argument
96 size2 += size1; in safe_malloc_add_3op_()
97 if(size2 < size1) in safe_malloc_add_3op_()
99 size3 += size2; in safe_malloc_add_3op_()
100 if(size3 < size2) in safe_malloc_add_3op_()
105 static inline void *safe_malloc_add_4op_(size_t size1, size_t size2, size_t size3, size_t size4) in safe_malloc_add_4op_() argument
107 size2 += size1; in safe_malloc_add_4op_()
108 if(size2 < size1) in safe_malloc_add_4op_()
110 size3 += size2; in safe_malloc_add_4op_()
111 if(size3 < size2) in safe_malloc_add_4op_()
119 void *safe_malloc_mul_2op_(size_t size1, size_t size2) ;
121 static inline void *safe_malloc_mul_3op_(size_t size1, size_t size2, size_t size3) in safe_malloc_mul_3op_() argument
123 if(!size1 || !size2 || !size3) in safe_malloc_mul_3op_()
125 if(size1 > SIZE_MAX / size2) in safe_malloc_mul_3op_()
127 size1 *= size2; in safe_malloc_mul_3op_()
134 static inline void *safe_malloc_mul2add_(size_t size1, size_t size2, size_t size3) in safe_malloc_mul2add_() argument
136 if(!size1 || !size2) in safe_malloc_mul2add_()
138 if(size1 > SIZE_MAX / size2) in safe_malloc_mul2add_()
140 return safe_malloc_add_2op_(size1*size2, size3); in safe_malloc_mul2add_()
144 static inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size3) in safe_malloc_muladd2_() argument
146 if(!size1 || (!size2 && !size3)) in safe_malloc_muladd2_()
148 size2 += size3; in safe_malloc_muladd2_()
149 if(size2 < size3) in safe_malloc_muladd2_()
151 if(size1 > SIZE_MAX / size2) in safe_malloc_muladd2_()
153 return malloc(size1*size2); in safe_malloc_muladd2_()
164 static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2) in safe_realloc_add_2op_() argument
166 size2 += size1; in safe_realloc_add_2op_()
167 if(size2 < size1) { in safe_realloc_add_2op_()
171 return realloc(ptr, size2); in safe_realloc_add_2op_()
174 static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3) in safe_realloc_add_3op_() argument
176 size2 += size1; in safe_realloc_add_3op_()
177 if(size2 < size1) in safe_realloc_add_3op_()
179 size3 += size2; in safe_realloc_add_3op_()
180 if(size3 < size2) in safe_realloc_add_3op_()
185 static inline void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size… in safe_realloc_add_4op_() argument
187 size2 += size1; in safe_realloc_add_4op_()
188 if(size2 < size1) in safe_realloc_add_4op_()
190 size3 += size2; in safe_realloc_add_4op_()
191 if(size3 < size2) in safe_realloc_add_4op_()
199 static inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2) in safe_realloc_mul_2op_() argument
201 if(!size1 || !size2) in safe_realloc_mul_2op_()
203 if(size1 > SIZE_MAX / size2) in safe_realloc_mul_2op_()
205 return safe_realloc_(ptr, size1*size2); in safe_realloc_mul_2op_()
209 static inline void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3) in safe_realloc_muladd2_() argument
211 if(!size1 || (!size2 && !size3)) in safe_realloc_muladd2_()
213 size2 += size3; in safe_realloc_muladd2_()
214 if(size2 < size3) in safe_realloc_muladd2_()
216 return safe_realloc_mul_2op_(ptr, size1, size2); in safe_realloc_muladd2_()