diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-01 12:59:01 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-12 18:29:25 +0200 |
commit | 633dccb458c4eaa40107cd7026737d804f90b6c0 (patch) | |
tree | 4a6e5ed3a35d4ca799df36d1c6eec3dd24ea9474 /hw/scsi/scsi-bus.c | |
parent | 1729404c62e1adae501feeaaf61b87262d52ae1b (diff) |
scsi: switch from g_slice allocator to malloc
Simplify memory allocation by sticking with a single API. GSlice
is not that fast anyway (tcmalloc/jemalloc are better).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-bus.c')
-rw-r--r-- | hw/scsi/scsi-bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ffac8f4bb6..d373c1b676 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -558,7 +558,7 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, const int memset_off = offsetof(SCSIRequest, sense) + sizeof(req->sense); - req = g_slice_alloc(reqops->size); + req = g_malloc(reqops->size); memset((uint8_t *)req + memset_off, 0, reqops->size - memset_off); req->refcount = 1; req->bus = bus; @@ -1622,7 +1622,7 @@ void scsi_req_unref(SCSIRequest *req) } object_unref(OBJECT(req->dev)); object_unref(OBJECT(qbus->parent)); - g_slice_free1(req->ops->size, req); + g_free(req); } } |