MCPcopy Create free account
hub / github.com/GJDuck/e9patch / target_push

Function target_push

examples/cfi.c:71–83  ·  view source on GitHub ↗

* Target push. */

Source from the content-addressed store, hash-verified

69 * Target push.
70 */
71static void target_push(uintptr_t target)
72{
73 if (TARGETs.size >= TARGETs.max)
74 {
75 TARGETs.lb = (TARGETs.max == 0? UINTPTR_MAX: TARGETs.lb);
76 TARGETs.max = (TARGETs.max == 0? 16: 2 * TARGETs.max);
77 TARGETs.data = (uintptr_t *)realloc(TARGETs.data,
78 TARGETs.max * sizeof(uintptr_t));
79 if (TARGETs.data == NULL)
80 error("failed to allocate memory: %s", strerror(errno));
81 }
82 TARGETs.data[TARGETs.size++] = target;
83}
84
85/*
86 * Target range.

Callers 1

initFunction · 0.85

Calls 3

reallocFunction · 0.85
errorFunction · 0.85
strerrorFunction · 0.85

Tested by

no test coverage detected