summaryrefslogtreecommitdiff
path: root/lib/x1000-installer/test_lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x1000-installer/test_lib')
-rw-r--r--lib/x1000-installer/test_lib/core_alloc.c7
-rw-r--r--lib/x1000-installer/test_lib/core_alloc.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/x1000-installer/test_lib/core_alloc.c b/lib/x1000-installer/test_lib/core_alloc.c
index 5d4edb03f7..719670f8f2 100644
--- a/lib/x1000-installer/test_lib/core_alloc.c
+++ b/lib/x1000-installer/test_lib/core_alloc.c
@@ -25,6 +25,7 @@
25#define N_POINTERS 100 25#define N_POINTERS 100
26 26
27static void* pointers[N_POINTERS]; 27static void* pointers[N_POINTERS];
28struct buflib_callbacks buflib_ops_locked = {NULL, NULL, NULL};
28 29
29int core_alloc(const char* name, size_t size) 30int core_alloc(const char* name, size_t size)
30{ 31{
@@ -46,6 +47,12 @@ int core_alloc(const char* name, size_t size)
46 return -1; 47 return -1;
47} 48}
48 49
50int core_alloc_ex(const char* name, size_t size, struct buflib_callbacks* cb)
51{
52 (void)cb;
53 return core_alloc(name, size);
54}
55
49int core_free(int handle) 56int core_free(int handle)
50{ 57{
51 if(handle > 0) { 58 if(handle > 0) {
diff --git a/lib/x1000-installer/test_lib/core_alloc.h b/lib/x1000-installer/test_lib/core_alloc.h
index 6fb06649fb..2c77e3c274 100644
--- a/lib/x1000-installer/test_lib/core_alloc.h
+++ b/lib/x1000-installer/test_lib/core_alloc.h
@@ -25,8 +25,18 @@
25#define CORE_ALLOC_H 25#define CORE_ALLOC_H
26 26
27#include <stddef.h> 27#include <stddef.h>
28#include <stdbool.h>
29
30struct buflib_callbacks {
31 int (*move_callback)(int handle, void* current, void* new);
32 int (*shrink_callback)(int handle, unsigned hints, void* start, size_t old_size);
33 void (*sync_callback)(int handle, bool sync_on);
34};
35
36extern struct buflib_callbacks buflib_ops_locked;
28 37
29int core_alloc(const char* name, size_t size); 38int core_alloc(const char* name, size_t size);
39int core_alloc_ex(const char* name, size_t size, struct buflib_callbacks* cb);
30int core_free(int handle); 40int core_free(int handle);
31void* core_get_data(int handle); 41void* core_get_data(int handle);
32 42