1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Resolve issue with resolving malloc() and free() functions at linking time.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Hans Petter Selasky 2014-05-30 14:30:52 +00:00
parent 70d843035e
commit 237f18c95a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266887
2 changed files with 13 additions and 10 deletions

View File

@ -430,7 +430,6 @@ size_t strlen(const char *s);
/* MALLOC API */
#ifndef HAVE_MALLOC
#undef malloc
#define malloc(s,x,f) usb_malloc(s)
void *usb_malloc(size_t);
@ -438,15 +437,6 @@ void *usb_malloc(size_t);
#undef free
#define free(p,x) usb_free(p)
void usb_free(void *);
#else
#undef malloc
void *malloc(size_t);
#define malloc(s,x,f) malloc(s)
#undef free
void free(void *);
#define free(p,x) free(p)
#endif
#define strdup(p,x) usb_strdup(p)
char *usb_strdup(const char *str);

View File

@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
extern int usleep(int);
@ -36,6 +37,18 @@ extern void usb_uninit(void);
#define hz 1000
void *
usb_malloc(size_t size)
{
return (malloc(size));
}
void
usb_free(void *ptr)
{
free(ptr);
}
void
DELAY(unsigned int delay)
{