Allocated mem block size

Hi.
Somebody knows how to determine allocated memory block size through the pointer? Required for sqlite integration and will be good to avoid duplicated software layer.

How are you allocating memory? Using adl_memget() API??

Yes.

Hi,

I did not find any way to get the memory block size from the pointer returned by adl_memget. It would be intereting if some one have a clue on this…

A little disappointment, because module firmware already knows all block sizes internally. Function like adl_memSize() may be helpful in the future.

But the same could be said of the standard malloc(), couldn’t it :question:

I guess the assumption is that you called for the block to be allocated, so you should know what size you asked for…

SQLITE engine require substitution of memory allocation functions (and block size function specifically) and file system functions (through Virtual File System - VFS - definition). You can say its SQLITE who should know allocated blocks sizes, but C’est la vie.

So how do other implementations typically do it?

Presumably, you’d write some sort of “wrapper” for malloc() or adl_memget() or whatever … :question:

Already, already… But why not to ask?