summaryrefslogtreecommitdiff
path: root/upb/bindings/linux/stdlib.h
blob: 8381b13bbdf009c530e9063ee328572e6b0cb20e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * upb - a minimalist implementation of protocol buffers.
 *
 * Copyright (c) 2012 Google Inc.  See LICENSE for details.
 * Author: Josh Haberman <jhaberman@gmail.com>
 *
 * Linux-kernel implementations of some stdlib.h functions.
 */

#include <linux/slab.h>

#ifndef UPB_LINUX_STDLIB_H
#define UPB_LINUX_STDLIB_H

static inline void *malloc(size_t size) { return kmalloc(size, GFP_ATOMIC); }
static inline void free(void *p) { kfree(p); }

static inline void *realloc(void *p, size_t size) {
  return krealloc(p, size, GFP_ATOMIC);
}

#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback