base/test/unittest/common/utils_parcel_test.cpp
bool SendData(void *&buffer, size_t size, const uint8_t *data)
{
    if (size <= 0) {
        return false;
    }
    buffer = malloc(size);
    if (buffer == nullptr) {
        return false;
    }
    if (memcpy_s(buffer, size, data, size) != EOK) {
        return false;
    }
    return true;
}
/**
 * Here to simulate the scenario of ipc sending data, the buffer will be released when the Parcel object is destructed.
*/
Here to simulate the scenario of ipc sending data, the buffer will be released when the Parcel object is destructed.
Here to simulate the scenario of ipc sending data the buffer will be released when the Parcel object is destructed .
bool SendData(void *&buffer, size_t size, const uint8_t *data)
{
    if (size <= 0) {
        return false;
    }
    buffer = malloc(size);
    if (buffer == nullptr) {
        return false;
    }
    if (memcpy_s(buffer, size, data, size) != EOK) {
        return false;
    }
    return true;
}
bool SendData ( void * & buffer , size_t size , const uint8_t * data ) { if ( size <= 0 ) { return false ; } buffer = malloc ( size ) ; if ( buffer == nullptr ) { return false ; } if ( memcpy_s ( buffer , size , data , size ) != EOK ) { return false ; } return true ; }
Here to simulate the scenario of ipc sending data, the buffer will be released when the Parcel object is destructed.
Here to simulate the scenario of ipc sending data the buffer will be released when the Parcel object is destructed .