Forgot to remove a couple of unnecessary work_buffer copies.
This commit is contained in:
parent
56c1617f8e
commit
497b9ca70f
1 changed files with 1 additions and 25 deletions
|
@ -904,19 +904,6 @@ static int bdberl_drv_control(ErlDrvData handle, unsigned int cmd,
|
||||||
{
|
{
|
||||||
FAIL_IF_ASYNC_PENDING(d, outbuf);
|
FAIL_IF_ASYNC_PENDING(d, outbuf);
|
||||||
|
|
||||||
// Inbuf is <<Flags:32 >>
|
|
||||||
// If the working buffer is large enough, copy the data to put/get into it. Otherwise, realloc
|
|
||||||
// until it is large enough
|
|
||||||
if (d->work_buffer_sz < inbuf_sz)
|
|
||||||
{
|
|
||||||
d->work_buffer = driver_realloc(d->work_buffer, inbuf_sz);
|
|
||||||
d->work_buffer_sz = inbuf_sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy the payload into place
|
|
||||||
memcpy(d->work_buffer, inbuf, inbuf_sz);
|
|
||||||
d->work_buffer_offset = inbuf_sz;
|
|
||||||
|
|
||||||
// Mark the port as busy and then schedule the appropriate async operation
|
// Mark the port as busy and then schedule the appropriate async operation
|
||||||
d->async_op = cmd;
|
d->async_op = cmd;
|
||||||
d->async_pool = G_TPOOL_GENERAL;
|
d->async_pool = G_TPOOL_GENERAL;
|
||||||
|
@ -945,17 +932,6 @@ static int bdberl_drv_control(ErlDrvData handle, unsigned int cmd,
|
||||||
FAIL_IF_ASYNC_PENDING(d, outbuf);
|
FAIL_IF_ASYNC_PENDING(d, outbuf);
|
||||||
|
|
||||||
// Inbuf is <<Flags:32 >>
|
// Inbuf is <<Flags:32 >>
|
||||||
// If the working buffer is large enough, copy the data to put/get into it. Otherwise, realloc
|
|
||||||
// until it is large enough
|
|
||||||
if (d->work_buffer_sz < inbuf_sz)
|
|
||||||
{
|
|
||||||
d->work_buffer = driver_realloc(d->work_buffer, inbuf_sz);
|
|
||||||
d->work_buffer_sz = inbuf_sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy the payload into place
|
|
||||||
memcpy(d->work_buffer, inbuf, inbuf_sz);
|
|
||||||
d->work_buffer_offset = inbuf_sz;
|
|
||||||
|
|
||||||
// Mark the port as busy and then schedule the appropriate async operation
|
// Mark the port as busy and then schedule the appropriate async operation
|
||||||
d->async_op = cmd;
|
d->async_op = cmd;
|
||||||
|
|
Loading…
Reference in a new issue