OpenSDN source code
task_block_api.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #include <string.h>
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 #include "task_block_api.h"
11 #ifdef __cplusplus
12 }
13 #endif
14 
15 block_t task_block_init(size_t size, const char *name)
16 {
17  return (block_t)size;
18 }
19 
21 {
22  void *memory = malloc((size_t)block);
23  if (!memory) {
24  return NULL;
25  }
26 
27  memset(memory, 0x00, block);
28 
29  return memory;
30 }
31 
32 void task_block_free(block_t block, void *mem)
33 {
34  free(mem);
35 }
36 
void * task_block_alloc(block_t block)
block_t task_block_init(size_t size, const char *name)
void task_block_free(block_t block, void *mem)
unsigned long block_t