/freebsd/crypto/openssh/openbsd-compat/ |
H A D | recallocarray.c | 40 size_t oldsize, newsize; in recallocarray() local 58 oldsize = oldnmemb * size; in recallocarray() 64 if (newsize <= oldsize) { in recallocarray() 65 size_t d = oldsize - newsize; in recallocarray() 67 if (d < oldsize / 2 && d < (size_t)getpagesize()) { in recallocarray() 77 if (newsize > oldsize) { in recallocarray() 78 memcpy(newptr, ptr, oldsize); in recallocarray() 79 memset((char *)newptr + oldsize, 0, newsize - oldsize); in recallocarray() 83 explicit_bzero(ptr, oldsize); in recallocarray()
|
/freebsd/contrib/libfido2/openbsd-compat/ |
H A D | recallocarray.c | 41 size_t oldsize, newsize; in recallocarray() local 59 oldsize = oldnmemb * size; in recallocarray() 65 if (newsize <= oldsize) { in recallocarray() 66 size_t d = oldsize - newsize; in recallocarray() 68 if (d < oldsize / 2 && d < (size_t)getpagesize()) { in recallocarray() 78 if (newsize > oldsize) { in recallocarray() 79 memcpy(newptr, ptr, oldsize); in recallocarray() 80 memset((char *)newptr + oldsize, 0, newsize - oldsize); in recallocarray() 84 explicit_bzero(ptr, oldsize); in recallocarray()
|
/freebsd/contrib/mandoc/ |
H A D | compat_recallocarray.c | 44 size_t oldsize, newsize; in recallocarray() local 62 oldsize = oldnmemb * size; in recallocarray() 68 if (newsize <= oldsize) { in recallocarray() 69 size_t d = oldsize - newsize; in recallocarray() 71 if (d < oldsize / 2 && d < getpagesize()) { in recallocarray() 81 if (newsize > oldsize) { in recallocarray() 82 memcpy(newptr, ptr, oldsize); in recallocarray() 83 memset((char *)newptr + oldsize, 0, newsize - oldsize); in recallocarray()
|
/freebsd/usr.bin/bsdiff/bsdiff/ |
H A D | bsdiff.c | 53 static off_t matchlen(u_char *old,off_t oldsize,u_char *new,off_t newsize) in matchlen() 57 for(i=0;(i<oldsize)&&(i<newsize);i++) in matchlen() 63 static off_t search(off_t *I,u_char *old,off_t oldsize, in search() 69 x=matchlen(old+I[st],oldsize-I[st],new,newsize); in search() 70 y=matchlen(old+I[en],oldsize-I[en],new,newsize); in search() 82 if(memcmp(old+I[x],new,MIN(oldsize-I[x],newsize))<0) { in search() 83 return search(I,old,oldsize,new,newsize,x,en,pos); in search() 85 return search(I,old,oldsize,new,newsize,st,x,pos); in search() 119 off_t oldsize,newsize,xnewsize; in main() 138 /* Allocate oldsize in main() 52 matchlen(u_char * old,off_t oldsize,u_char * new,off_t newsize) matchlen() argument 62 search(off_t * I,u_char * old,off_t oldsize,u_char * new,off_t newsize,off_t st,off_t en,off_t * pos) search() argument 118 off_t oldsize,newsize; main() local [all...] |
/freebsd/tests/sys/cddl/zfs/tests/interop/ |
H A D | interop_001_pos.ksh | 65 typeset -i oldsize=`$ZFS get -pH -o value available $TESTPOOL` 73 (( $oldsize >= $newsize )) && \ 74 log_fail "Pool space available ($oldsize) before adding a new device was "\ 77 log_note "Pool space available was ($oldsize), it's now ($newsize)" 91 (( $retval == $ENOSPC && $afterwritepoolavail < $oldsize)) && \ 92 log_pass "Successfully used ($(( $newsize - $oldsize )) bytes) in "\ 95 log_fail "Failed to use space in pool ($(( $newsize - $oldsize ))bytes) "\
|
/freebsd/contrib/jemalloc/include/jemalloc/internal/ |
H A D | jemalloc_internal_inlines_c.h | 135 iralloct_realign(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, in iralloct_realign() argument 155 copysize = (size < oldsize) ? size : oldsize; in iralloct_realign() 162 isdalloct(tsdn, ptr, oldsize, tcache, NULL, true); in iralloct_realign() 174 iralloct(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, size_t alignment, in iralloct() argument 188 return iralloct_realign(tsdn, ptr, oldsize, size, alignment, in iralloct() 192 return arena_ralloc(tsdn, arena, ptr, oldsize, size, alignment, zero, in iralloct() 197 iralloc(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, size_t alignment, in iralloc() argument 199 return iralloct(tsd_tsdn(tsd), ptr, oldsize, size, alignment, zero, in iralloc() 204 ixalloc(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, size_t extra, in ixalloc() argument 214 *newsize = oldsize; in ixalloc() [all …]
|
H A D | arena_externs.h | 40 extent_t *extent, size_t oldsize); 42 extent_t *extent, size_t oldsize); 69 bool arena_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, 71 void *arena_ralloc(tsdn_t *tsdn, arena_t *arena, void *ptr, size_t oldsize,
|
/freebsd/tools/test/stress2/testcases/swap/ |
H A D | swap.c | 134 int64_t i, oldsize; in test() local 140 oldsize = size; in test() 146 if (op->verbose > 1 && size != oldsize) in test() 148 (int)(oldsize / 1024 / 1024), (int)(size / 1024 / 102)); in test()
|
/freebsd/usr.bin/bsdiff/bspatch/ |
H A D | bspatch.c | 108 off_t oldsize, newsize; in main() 223 if ((oldsize = lseek(oldfd, 0, SEEK_END)) == -1 || in main() 224 oldsize > SSIZE_MAX) in main() 227 old = mmap(NULL, oldsize+1, PROT_READ, MAP_SHARED, oldfd, 0); in main() 263 if (add_off_t(oldpos, i) < oldsize) in main() 299 munmap(old, oldsize+1); in main() 107 off_t oldsize, newsize; main() local
|
/freebsd/sys/contrib/openzfs/lib/libzfs_core/os/freebsd/ |
H A D | libzfs_core_ioctl.c | 105 size_t oldsize; in lzc_ioctl_fd() local 125 oldsize = zc->zc_nvlist_dst_size; in lzc_ioctl_fd() 128 if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) { in lzc_ioctl_fd()
|
/freebsd/usr.bin/mail/ |
H A D | util.c | 69 int oldsize = old ? strlen(old) + 1 : 0; in save2str() local 71 if ((new = salloc(newsize + oldsize)) != NULL) { in save2str() 72 if (oldsize) { in save2str() 73 bcopy(old, new, oldsize); in save2str() 74 new[oldsize - 1] = ' '; in save2str() 76 bcopy(str, new + oldsize, newsize); in save2str()
|
/freebsd/tests/sys/fs/fusefs/ |
H A D | last_local_modify.cc | 214 const uint64_t oldsize = 10; in TEST_P() local 235 out.body.entry.attr.size = oldsize; in TEST_P() 282 out0->body.entry.attr.size = oldsize; in TEST_P() 368 const uint64_t oldsize = 10; in TEST_P() local 394 out.body.entry.attr.size = oldsize; in TEST_P() 416 out.body.entry.attr.size = oldsize; in TEST_P() 444 out0->body.entry.attr.size = oldsize; in TEST_P()
|
H A D | write.cc | 311 uint64_t oldsize = m_maxbcachebuf / 2; in TEST_F() local 314 oldcontents = new char[oldsize](); in TEST_F() 315 oldbuf = new char[oldsize]; in TEST_F() 317 expect_lookup(RELPATH, ino, oldsize); in TEST_F() 319 expect_read(ino, 0, oldsize, oldsize, oldcontents); in TEST_F() 320 maybe_expect_write(ino, oldsize, BUFSIZE, CONTENTS); in TEST_F() 327 ASSERT_EQ((ssize_t)oldsize, read(fd, oldbuf, oldsize)) in TEST_F()
|
H A D | setattr.cc | 351 const off_t oldsize = 99; in TEST_F() local 360 out.body.entry.attr.size = oldsize; in TEST_F() 402 const uint64_t oldsize = 100'000'000; in TEST_F() local 410 out.body.entry.attr.size = oldsize; in TEST_F() 571 const uint64_t oldsize = 0; in TEST_F() local 579 out.body.entry.attr.size = oldsize; in TEST_F()
|
/freebsd/contrib/libarchive/libarchive/test/ |
H A D | test_fuzz.c | 74 size_t size = 0, oldsize = 0; in test_fuzz() 123 newraw = realloc(rawimage, oldsize + size); in test_fuzz() 131 memcpy(rawimage + oldsize, tmp, size); in test_fuzz() 132 oldsize += size; in test_fuzz() 133 size = oldsize; in test_fuzz() 75 size_t size = 0, oldsize = 0; test_fuzz() local
|
/freebsd/contrib/lua/src/ |
H A D | lmem.c | 131 size_t oldsize = cast_sizet((*size) * size_elem); in luaM_shrinkvector_() local 133 lua_assert(newsize <= oldsize); in luaM_shrinkvector_() 134 newblock = luaM_saferealloc_(L, block, oldsize, newsize); in luaM_shrinkvector_()
|
H A D | lmem.h | 80 LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, 82 LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize,
|
H A D | ltests.c | 210 void *debug_realloc (void *ud, void *b, size_t oldsize, size_t size) { in debug_realloc() argument 219 type = (oldsize < LUA_NUMTAGS) ? oldsize : 0; in debug_realloc() 220 oldsize = 0; in debug_realloc() 225 lua_assert(oldsize == block->d.size); in debug_realloc() 235 if (mc->countlimit != ~0UL && size != oldsize) { /* count limit in use? */ in debug_realloc() 240 if (size > oldsize && mc->total+size-oldsize > mc->memlimit) in debug_realloc() 245 size_t commonsize = (oldsize < size) ? oldsize : size; in debug_realloc()
|
/freebsd/sbin/rcorder/ |
H A D | hash.c | 404 int oldsize; in RebuildTable() local 407 oldsize = i = t->size; in RebuildTable() 414 for (hp = oldhp, i = oldsize; --i >= 0;) { in RebuildTable()
|
/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | slab.h | 213 kvrealloc(const void *ptr, size_t oldsize, size_t newsize, gfp_t flags) in kfree_sensitive() 217 if (newsize <= oldsize) 222 memcpy(newptr, ptr, oldsize); in kvrealloc() 218 kvrealloc(const void * ptr,size_t oldsize,size_t newsize,gfp_t flags) kvrealloc() argument
|
/freebsd/sys/kern/ |
H A D | kern_ktrace.c | 166 static u_int ktrace_resize_pool(u_int oldsize, u_int newsize); 238 u_int newsize, oldsize, wantsize; in sysctl_kern_ktrace_request_pool() local 243 oldsize = ktr_requestpool; in sysctl_kern_ktrace_request_pool() 244 return (SYSCTL_OUT(req, &oldsize, sizeof(u_int))); in sysctl_kern_ktrace_request_pool() 252 oldsize = ktr_requestpool; in sysctl_kern_ktrace_request_pool() 253 newsize = ktrace_resize_pool(oldsize, wantsize); in sysctl_kern_ktrace_request_pool() 255 error = SYSCTL_OUT(req, &oldsize, sizeof(u_int)); in sysctl_kern_ktrace_request_pool() 258 if (wantsize > oldsize && newsize < wantsize) in sysctl_kern_ktrace_request_pool() 268 ktrace_resize_pool(u_int oldsize, u_int newsize) in ktrace_resize_pool() argument 275 bound = newsize - oldsize; in ktrace_resize_pool() [all …]
|
/freebsd/lib/libc/stdio/ |
H A D | printf-pos.c | 638 const int oldsize = types->tablesize; in __grow_type_table() local 646 newsize = oldsize * 2; in __grow_type_table() 649 if (oldsize == STATIC_ARG_TBL_SIZE) { in __grow_type_table() 652 bcopy(oldtable, newtable, oldsize * sizeof(enum typeid)); in __grow_type_table() 658 for (n = oldsize; n < newsize; n++) in __grow_type_table()
|
/freebsd/contrib/jemalloc/src/ |
H A D | arena.c | 1740 arena_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, in arena_ralloc_no_move() argument 1754 if (likely(oldsize <= SC_SMALL_MAXCLASS && usize_min in arena_ralloc_no_move() 1760 assert(bin_infos[sz_size2index(oldsize)].reg_size == in arena_ralloc_no_move() 1761 oldsize); in arena_ralloc_no_move() 1763 || sz_size2index(usize_max) != sz_size2index(oldsize)) in arena_ralloc_no_move() 1764 && (size > oldsize || usize_max < oldsize)) { in arena_ralloc_no_move() 1771 } else if (oldsize >= SC_LARGE_MINCLASS in arena_ralloc_no_move() 1800 arena_ralloc(tsdn_t *tsdn, arena_t *arena, void *ptr, size_t oldsize, in arena_ralloc() argument 1811 if (!arena_ralloc_no_move(tsdn, ptr, oldsize, usize, 0, zero, in arena_ralloc() 1815 ptr, oldsize, usize, (uintptr_t)ptr, in arena_ralloc() [all …]
|
/freebsd/lib/geom/eli/ |
H A D | geom_eli.c | 1826 off_t mediasize, oldsize; in eli_resize() local 1860 oldsize = gctl_get_intmax(req, "oldsize"); in eli_resize() 1861 if (oldsize < 0 || oldsize > mediasize) { in eli_resize() 1867 if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { in eli_resize() 1898 if (md.md_provsize != (uint64_t)oldsize) { in eli_resize() 1904 if (oldsize == mediasize) in eli_resize() 1915 (void)eli_trash_metadata(req, prov, provfd, oldsize - secsize); in eli_resize()
|
/freebsd/sys/contrib/openzfs/module/lua/ |
H A D | lmem.h | 48 LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
|