Hi, Lixun!
On Apr 27, Lixun Peng wrote:
> Hi Sergei,
>
> I only have Linux and Mac OS X environment. I test on GCC 4.1 and GCC
> 4.2, GCC 4.1 have malloc_usable_size and GCC 4.3 have malloc_size.
> Which malloc_usable_size can run on Linux, and malloc_size can run
> on Mac OS X.
> I think we can use macro to select malloc_usable_size or malloc_size.
Certainly.
> Before I found malloc_usable_size/ malloc_size, I tested a method
> that by allocate space to store size.
> Like "point=malloc(size+sizeof(size_t)); memcpy(point, &size,
> sizeof(size_t)); return print+sizeof(size_t);" and "memcpy(&size, point,
> sizeof(size_t)); free(point-sizeof(size_t))",
> but it run test case fail, so I give up this way.
Yes, that's what I meant. I wonder why the tests fail for you.
But never mind, it's not really important, if malloc_usable_size is
sufficient.
> Because all of my OS are Linux, so I use "malloc_usable_size/
> malloc_size " way.
> I think you can try the way above. I have no enough time to DEBUG,
> because I'm a DBA, I only can try above way if I have enough time.
Well, I think you've done more than enough already :)
I'll see if we can get it into MariaDB.
But I don't know what are Percona's criteria for including your patch.
Regards,
Sergei