From 847ddbf72eccf2e45448d19908e28e0c0bfbdf50 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 14 Apr 2015 12:11:04 +0200 Subject: [PATCH] os: Remove new operator from packet_stream.h --- repos/os/include/os/packet_stream.h | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/repos/os/include/os/packet_stream.h b/repos/os/include/os/packet_stream.h index 190c67073d..9159cf30a0 100644 --- a/repos/os/include/os/packet_stream.h +++ b/repos/os/include/os/packet_stream.h @@ -80,6 +80,7 @@ #include #include #include +#include namespace Genode { @@ -512,18 +513,6 @@ struct Genode::Packet_stream_policy }; -/** - * Placement new operator for constructing packet-descriptor queues - * - * The third argument is only there to let the compiler choose this overloaded - * new operator rather than Genode's new operator. - * - * This operator should not be used outside the packet-stream interface. - */ -inline void *operator new(Genode::size_t size, void *addr, - Genode::Packet_stream_base *) { return addr; } - - /** * Originator of a packet stream */ @@ -573,10 +562,10 @@ class Genode::Packet_stream_source : private Packet_stream_base _packet_alloc(packet_alloc), /* construct packet-descriptor queues */ - _submit_transmitter(new (_submit_queue_local_base(), this) - Submit_queue(Submit_queue::PRODUCER)), - _ack_receiver(new (_ack_queue_local_base(), this) - Ack_queue(Ack_queue::CONSUMER)) + _submit_transmitter(construct_at(_submit_queue_local_base(), + Submit_queue::PRODUCER)), + _ack_receiver(construct_at(_ack_queue_local_base(), + Ack_queue::CONSUMER)) { /* initialize packet allocator */ _packet_alloc->add_range(_bulk_buffer_offset, @@ -739,10 +728,10 @@ class Genode::Packet_stream_sink : private Packet_stream_base Packet_stream_base(transport_ds, sizeof(Submit_queue), sizeof(Ack_queue)), /* construct packet-descriptor queues */ - _submit_receiver(new (_submit_queue_local_base(), this) - Submit_queue(Submit_queue::CONSUMER)), - _ack_transmitter(new (_ack_queue_local_base(), this) - Ack_queue(Ack_queue::PRODUCER)) + _submit_receiver(construct_at(_submit_queue_local_base(), + Submit_queue::CONSUMER)), + _ack_transmitter(construct_at(_ack_queue_local_base(), + Ack_queue::PRODUCER)) { } /**