4 * @copyright Copyright (C) 2016 Sproute Networks, Inc.
6 * @author Avneesh Sachdev <avneesh@sproute.com>
8 * This file is part of Quagga.
10 * Quagga is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2, or (at your option) any
15 * Quagga is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Quagga; see the file COPYING. If not, write to the Free
22 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 #include "linear_allocator.h"
28 #include "qpb_allocator.h"
34 _qpb_alloc (void *allocator_data
, size_t size
)
36 return linear_allocator_alloc (allocator_data
, size
);
43 _qpb_free (void *allocator_data
, void *ptr
)
45 linear_allocator_free (allocator_data
, ptr
);
48 static ProtobufCAllocator allocator_template
= {
57 * qpb_allocator_init_linear
59 * Initialize qpb_allocator_t with the given linear allocator.
62 qpb_allocator_init_linear (qpb_allocator_t
*allocator
,
63 linear_allocator_t
*linear_allocator
)
65 *allocator
= allocator_template
;
66 allocator
->allocator_data
= linear_allocator
;