Problem about memory allocation

J

Joe.ntang

Hi,

The following function is what I want to call,

int
DbEnv::memp_stat(DB_MPOOL_STAT **gsp,
DB_MPOOL_FSTAT *(*fsp)[], u_int32_t flags);

The function has following description:

The DbEnv::memp_stat method creates statistical structures of type
DB_MPOOL_STAT and DB_MPOOL_FSTAT, and copy pointers to them into
user-specified memory locations.

Can anybody tell me how to allocate the memory to satisfy the function
requirement?

Sincerely,
Joe
 
A

Alf P. Steinbach

* (e-mail address removed):
The following function is what I want to call,

int
DbEnv::memp_stat(DB_MPOOL_STAT **gsp,
DB_MPOOL_FSTAT *(*fsp)[], u_int32_t flags);

The function has following description:

The DbEnv::memp_stat method creates statistical structures of type
DB_MPOOL_STAT and DB_MPOOL_FSTAT, and copy pointers to them into
user-specified memory locations.

Can anybody tell me how to allocate the memory to satisfy the function
requirement?

See the documentation and/or example code.

The quoted passage indicates that the function does the allocation, so
possibly you'd call it like

DB_MPOOL_STAT* stat;
DB_MPOOL_FSTAT** fstats;
int const result = memp_stat( &stat, &fstats, whatever );

However, you can't be sure without going to the documentation (and/or
example code); in particular you can't be sure how to /deallocate/.

Off-topicality:

Please note that questions about how to use a platform-specific library
are, in general, off-topic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top