use plan9 malloc

This commit is contained in:
rsc 2004-06-09 14:12:04 +00:00
parent e290cfc138
commit d1b4cfde55
4 changed files with 8 additions and 12 deletions

View file

@ -25,7 +25,9 @@
#define vlong _fmtvlong #define vlong _fmtvlong
#define uvlong _fmtuvlong #define uvlong _fmtuvlong
#ifndef USED
#define USED(x) if(x);else #define USED(x) if(x);else
#endif
typedef unsigned char uchar; typedef unsigned char uchar;
typedef unsigned short ushort; typedef unsigned short ushort;
@ -37,6 +39,7 @@ typedef unsigned long long uvlong;
typedef long long vlong; typedef long long vlong;
#endif #endif
#undef nil
#define nil 0 /* cannot be ((void*)0) because used for function pointers */ #define nil 0 /* cannot be ((void*)0) because used for function pointers */
typedef int (*Fmts)(Fmt*); typedef int (*Fmts)(Fmt*);

View file

@ -11,11 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include <stdlib.h>
#include "utf.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
static int static int

View file

@ -11,11 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include <stdlib.h>
#include "utf.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
static int static int

View file

@ -31,6 +31,5 @@ vsmprint(char *fmt, va_list args)
n = dofmt(&f, fmt); n = dofmt(&f, fmt);
if(n < 0) if(n < 0)
return nil; return nil;
*(char*)f.to = '\0'; return fmtstrflush(&f);
return (char*)f.start;
} }