mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
pvector: Move PVECTOR_EXTRA_ALLOC to pvector.c.
There is no need to expose PVECTOR_EXTRA_ALLOC in the API. Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Nicira, Inc.
|
* Copyright (c) 2014, 2016 Nicira, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,6 +17,10 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "pvector.h"
|
#include "pvector.h"
|
||||||
|
|
||||||
|
/* Writers will preallocate space for some entries at the end to avoid future
|
||||||
|
* reallocations. */
|
||||||
|
enum { PVECTOR_EXTRA_ALLOC = 4 };
|
||||||
|
|
||||||
static struct pvector_impl *
|
static struct pvector_impl *
|
||||||
pvector_impl_get(const struct pvector *pvec)
|
pvector_impl_get(const struct pvector *pvec)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Nicira, Inc.
|
* Copyright (c) 2014, 2016 Nicira, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -63,10 +63,6 @@ struct pvector_entry {
|
|||||||
void *ptr;
|
void *ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Writers will preallocate space for some entries at the end to avoid future
|
|
||||||
* reallocations. */
|
|
||||||
enum { PVECTOR_EXTRA_ALLOC = 4 };
|
|
||||||
|
|
||||||
struct pvector_impl {
|
struct pvector_impl {
|
||||||
size_t size; /* Number of entries in the vector. */
|
size_t size; /* Number of entries in the vector. */
|
||||||
size_t allocated; /* Number of allocated entries. */
|
size_t allocated; /* Number of allocated entries. */
|
||||||
|
|||||||
Reference in New Issue
Block a user