Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvMsg::expand()

Method

## Declaration

    TibrvStatus expand(tibrv_u32 additionalStorage);

## Purpose

Enlarge a message by allocating additional storage.

## Remarks

When adding data to a message would overflow the allocated space, the message automatically expands by allocating additional storage. However, reallocation (whether explicit or automatic) is a slow operation; to optimize program performance, we recommend allocating sufficient storage initially, so that reallocation is not required.

In most cases, the message expands in place (without copying). In some cases, this method copies the message to a new location. In all cases, existing pointers to the message, its fields, and its field values remain valid (even after copying).

If no space is available, this method returns the error code TIBRV_NO_MEMORY.

Parameter | Description
`additionalStorage` | Enlarge the message by this amount (in bytes) to allocate for the message. If the message was `oldSize` bytes before this call, it is `oldSize + additionalStorage` when the method returns.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.