Re: [vpp-dev] clib_mem_size return wrong mem size

2020-08-29 Thread Dave Barach via lists.fd.io
you’re doing. We won’t be changing the memory allocator API / contract / promise to track the original request size. Dave From: vpp-dev@lists.fd.io On Behalf Of jiangxiaom...@outlook.com Sent: Friday, August 28, 2020 11:11 PM To: vpp-dev@lists.fd.io Subject: Re: [vpp-dev] clib_mem_size return

Re: [vpp-dev] clib_mem_size return wrong mem size

2020-08-28 Thread jiangxiaoming
Hi,  Dave Barach: I want to a realloc funtion like as bollow, the function args doesn't have the original mem size, and clib_mem_size seems can't return the right memory size. Is there any way to get the memory size ? void *my _realloc ( void * p , size_t s) { return p ? clib_mem_realloc ( p ,

Re: [vpp-dev] clib_mem_size return wrong mem size

2020-08-28 Thread Dave Barach via lists.fd.io
clib_mem_size() returns the object’s capacity, which will be >= number of bytes requested... From: vpp-dev@lists.fd.io On Behalf Of jiangxiaom...@outlook.com Sent: Thursday, August 27, 2020 11:26 PM To: vpp-dev@lists.fd.io Subject: [vpp-dev] clib_mem_size return wrong mem size Hi, expe

[vpp-dev] clib_mem_size return wrong mem size

2020-08-27 Thread jiangxiaoming
Hi, experts: I find clib_mem_size(...) cann't return the mem size alloc by  clib_mem_alloc(...). I alloc 32 bytes memory, but clib_mem_size return 44 length as following snippet: > > u32 len, real_len; > void* p; > > len = 32; > p = clib_mem_alloc(len); > real_len = clib_mem_size(p); > >