Blame support/blob_repeat.h

Packit Service f9020f
/* Repeating a memory blob, with alias mapping optimization.
Packit Service f9020f
   Copyright (C) 2018 Free Software Foundation, Inc.
Packit Service f9020f
   This file is part of the GNU C Library.
Packit Service f9020f
Packit Service f9020f
   The GNU C Library is free software; you can redistribute it and/or
Packit Service f9020f
   modify it under the terms of the GNU Lesser General Public
Packit Service f9020f
   License as published by the Free Software Foundation; either
Packit Service f9020f
   version 2.1 of the License, or (at your option) any later version.
Packit Service f9020f
Packit Service f9020f
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service f9020f
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service f9020f
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service f9020f
   Lesser General Public License for more details.
Packit Service f9020f
Packit Service f9020f
   You should have received a copy of the GNU Lesser General Public
Packit Service f9020f
   License along with the GNU C Library; if not, see
Packit Service f9020f
   <http://www.gnu.org/licenses/>.  */
Packit Service f9020f
Packit Service f9020f
#ifndef SUPPORT_BLOB_REPEAT_H
Packit Service f9020f
#define SUPPORT_BLOB_REPEAT_H
Packit Service f9020f
Packit Service f9020f
#include <stdbool.h>
Packit Service f9020f
#include <stddef.h>
Packit Service f9020f
Packit Service f9020f
struct support_blob_repeat
Packit Service f9020f
{
Packit Service f9020f
  void *start;
Packit Service f9020f
  size_t size;
Packit Service f9020f
  bool use_malloc;
Packit Service f9020f
};
Packit Service f9020f
Packit Service f9020f
/* Return an allocation of COUNT elements, each of ELEMENT_SIZE bytes,
Packit Service f9020f
   initialized with the bytes starting at ELEMENT.  The memory is
Packit Service f9020f
   writable (and thus counts towards the commit charge).  In case of
Packit Service f9020f
   on error, all members of the return struct are zero-initialized,
Packit Service f9020f
   and errno is set accordingly.  */
Packit Service f9020f
struct support_blob_repeat support_blob_repeat_allocate (const void *element,
Packit Service f9020f
                                                         size_t element_size,
Packit Service f9020f
                                                         size_t count);
Packit Service f9020f
Packit Service f9020f
/* Deallocate the blob created by support_blob_repeat_allocate.  */
Packit Service f9020f
void support_blob_repeat_free (struct support_blob_repeat *);
Packit Service f9020f
Packit Service f9020f
#endif /* SUPPORT_BLOB_REPEAT_H */