Skip to content

Instantly share code, notes, and snippets.

View bpetering's full-sized avatar

Ben Petering bpetering

View GitHub Profile
@bpetering
bpetering / test.c
Last active January 6, 2016 17:08
Nativecall problems #2
#include <stdio.h>
int
foo_generichash(unsigned char *out, size_t outlen, const unsigned char *in,
unsigned long long inlen)
{
unsigned long long i;
for (i = 0; i < inlen; i++) {
out[i] = in[i];
}
#include <stdio.h>
#include <stdlib.h>
struct foo {
int x;
};
void foo_init(struct foo **f) {
*f = malloc(sizeof(struct foo));
printf("malloc'd, pointer = %p\n", (void *) *f);
#include <stdio.h>
#include <stdlib.h>
struct foo {
int x;
};
void foo_init(struct foo **f) {
*f = malloc(sizeof(struct foo));
printf("malloc'd, pointer = %p\n", (void *) *f);