Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Berkely DB > DBT data field ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1779 of 1804
Post > Topic >>

DBT data field and DB_DBT_USERMEM flag

by oleksandr kalinin <alexka79@[EMAIL PROTECTED] > Jan 8, 2008 at 08:59 AM

Hello,

I am using free-threaded BerkeleyDB handles in conjunction with
DB_DBT_USERMEM flag. My application currently relies on DBT->data
remaining unchanged in the get() call, since own buffer is specified.
Is such assumption correct?

From do***entation on DBT structure:

"By default, the flags structure element is expected to be set to 0.
In this default case, when the application is providing Berkeley DB a
key or data item to store into the database, Berkeley DB expects the
data structure element to point to a byte string of size bytes. When
returning a key/data item to the application, Berkeley DB will store
into the data structure element a pointer to a byte string of size
bytes, and the memory to which the pointer refers will be allocated
and managed by Berkeley DB."

Looking at BerkeleyDB code, I can see that no internal memory
allocation seems to be done in case DB_DBT_USERMEM is specified, and
thus I assume that DBT->data remains unchanged. But I just would like
to crosscheck if I am missing something. Reading do***entation, it is
not really clear whether application may rely on DBT->data remaining
unchanged in get() call even when DB_DBT_USERMEM flag is specified,
rather not?

Thanks for your comments.

Regards,
Alex
 




 1 Posts in Topic:
DBT data field and DB_DBT_USERMEM flag
oleksandr kalinin <ale  2008-01-08 08:59:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 20 0:37:16 CDT 2008.